2004-01-27 Mike Kestner <mkestner@ximian.com>
* glib/Value.cs : only g_free values we allocate. [Fixes #51180] svn path=/trunk/gtk-sharp/; revision=22559
This commit is contained in:
parent
fc42fa2c04
commit
d4f6f6e928
2 changed files with 9 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2004-01-27 Mike Kestner <mkestner@ximian.com>
|
||||
|
||||
* glib/Value.cs : only g_free values we allocate.
|
||||
[Fixes #51180]
|
||||
|
||||
2004-01-27 Mike Kestner <mkestner@ximian.com>
|
||||
|
||||
* glib/TypeConverter.cs : lookup GTypes for boxed value types.
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace GLib {
|
|||
public class Value : IDisposable {
|
||||
|
||||
IntPtr _val;
|
||||
bool needs_dispose = true;
|
||||
|
||||
|
||||
// Destructor is required since we are allocating unmanaged
|
||||
|
@ -42,7 +43,8 @@ namespace GLib {
|
|||
ManagedValue.Free (g_value_get_boxed (_val));
|
||||
}
|
||||
|
||||
g_free (_val);
|
||||
if (needs_dispose)
|
||||
g_free (_val);
|
||||
_val = IntPtr.Zero;
|
||||
}
|
||||
|
||||
|
@ -67,6 +69,7 @@ namespace GLib {
|
|||
public Value (IntPtr val, IntPtr dummy)
|
||||
{
|
||||
_val = val;
|
||||
needs_dispose = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in a new issue