2009-07-21 Christian Hoff <christian_hoff@gmx.net>

* glib/GInterfaceAdapter.cs: Fix a leak related to GCHandles not being freed.
	Patch from Mike Kestner with a minor tweak by me. [Fixes #523306]

svn path=/trunk/gtk-sharp/; revision=138263
This commit is contained in:
Christian Hoff 2009-07-21 06:51:10 +00:00
parent 1cd652998e
commit a7bebb15b1

View file

@ -40,8 +40,6 @@ namespace GLib {
protected GInterfaceAdapter () protected GInterfaceAdapter ()
{ {
info.FinalizeHandler = new GInterfaceFinalizeHandler (Finalize);
info.Data = (IntPtr) GCHandle.Alloc (this);
} }
protected GInterfaceInitHandler InitHandler { protected GInterfaceInitHandler InitHandler {
@ -56,14 +54,11 @@ namespace GLib {
internal GInterfaceInfo Info { internal GInterfaceInfo Info {
get { get {
if (info.Data == IntPtr.Zero)
info.Data = (IntPtr) GCHandle.Alloc (this);
return info; return info;
} }
} }
void Finalize (IntPtr iface_ptr, IntPtr data)
{
GCHandle gch = (GCHandle) data;
gch.Free ();
}
} }
} }