2005-02-09 Mike Kestner <mkestner@novell.com>

* gtk/Widget.custom : use a static method for the ParentSet hack
	so we don't leak objects because the delegate holds an object ref.

svn path=/trunk/gtk-sharp/; revision=40346
This commit is contained in:
Mike Kestner 2005-02-09 18:11:31 +00:00
parent ec4072d1b5
commit 40f7e04616
2 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2005-02-09 Mike Kestner <mkestner@novell.com>
* gtk/Widget.custom : use a static method for the ParentSet hack
so we don't leak objects because the delegate holds an object ref.
2005-02-07 Ben Maurer <bmaurer@ximian.com> 2005-02-07 Ben Maurer <bmaurer@ximian.com>
* gdk/Point.custom, gdk/Rectangle.custom: misc. new apis to make * gdk/Point.custom, gdk/Rectangle.custom: misc. new apis to make

View file

@ -44,12 +44,13 @@ protected override void CreateNativeObject (string[] names, GLib.Value[] vals)
private static Hashtable ParentedWidgets = new Hashtable (); private static Hashtable ParentedWidgets = new Hashtable ();
private void Widget_ParentSet (object o, ParentSetArgs args) private static void Widget_ParentSet (object o, ParentSetArgs args)
{ {
if (Parent != null && args.PreviousParent == null) Widget w = o as Widget;
ParentedWidgets[this] = this; if (w.Parent != null && args.PreviousParent == null)
else if (Parent == null && args.PreviousParent != null) ParentedWidgets[w] = w;
ParentedWidgets.Remove (this); else if (w.Parent == null && args.PreviousParent != null)
ParentedWidgets.Remove (w);
} }
[DllImport("gtksharpglue-2")] [DllImport("gtksharpglue-2")]