mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-09-09 00:13:20 +02:00
2007-06-05 Mike Kestner <mkestner@novell.com>
* glib/ManagedValue.cs (ReleaseWrapper): new method. * glib/Value.cs : release the ManagedValue wrapper to avoid leaks. [Fixes #81799] svn path=/trunk/gtk-sharp/; revision=78669
This commit is contained in:
parent
3e3e0f1469
commit
b177644f06
@ -1,3 +1,9 @@
|
|||||||
|
2007-06-05 Mike Kestner <mkestner@novell.com>
|
||||||
|
|
||||||
|
* glib/ManagedValue.cs (ReleaseWrapper): new method.
|
||||||
|
* glib/Value.cs : release the ManagedValue wrapper to avoid leaks.
|
||||||
|
[Fixes #81799]
|
||||||
|
|
||||||
2007-05-03 Wade Berrier <wberrier@novell.com>
|
2007-05-03 Wade Berrier <wberrier@novell.com>
|
||||||
|
|
||||||
* generator/gapi2-codegen.in:
|
* generator/gapi2-codegen.in:
|
||||||
|
@ -93,6 +93,14 @@ namespace GLib {
|
|||||||
return null;
|
return null;
|
||||||
return ((GCHandle)ptr).Target;
|
return ((GCHandle)ptr).Target;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void ReleaseWrapper (IntPtr ptr)
|
||||||
|
{
|
||||||
|
if (ptr == IntPtr.Zero)
|
||||||
|
return;
|
||||||
|
|
||||||
|
((GCHandle)ptr).Free ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -376,9 +376,11 @@ namespace GLib {
|
|||||||
IntPtr buf = Marshal.AllocHGlobal (Marshal.SizeOf (value.GetType()));
|
IntPtr buf = Marshal.AllocHGlobal (Marshal.SizeOf (value.GetType()));
|
||||||
Marshal.StructureToPtr (value, buf, false);
|
Marshal.StructureToPtr (value, buf, false);
|
||||||
g_value_set_pointer (ref this, buf);
|
g_value_set_pointer (ref this, buf);
|
||||||
} else if (type == ManagedValue.GType.Val)
|
} else if (type == ManagedValue.GType.Val) {
|
||||||
g_value_set_boxed (ref this, ManagedValue.WrapObject (value));
|
IntPtr wrapper = ManagedValue.WrapObject (value);
|
||||||
else if (g_type_is_a (type, GType.Object.Val))
|
g_value_set_boxed (ref this, wrapper);
|
||||||
|
ManagedValue.ReleaseWrapper (wrapper);
|
||||||
|
} else if (g_type_is_a (type, GType.Object.Val))
|
||||||
g_value_set_object (ref this, ((GLib.Object) value).Handle);
|
g_value_set_object (ref this, ((GLib.Object) value).Handle);
|
||||||
else if (g_type_is_a (type, GType.Boxed.Val)) {
|
else if (g_type_is_a (type, GType.Boxed.Val)) {
|
||||||
if (value is IWrapper) {
|
if (value is IWrapper) {
|
||||||
|
Loading…
Reference in New Issue
Block a user