diff --git a/ChangeLog b/ChangeLog index 9511d5fee..8a7ab737d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-02-09 Mike Kestner + + * 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 * gdk/Point.custom, gdk/Rectangle.custom: misc. new apis to make diff --git a/gtk/Widget.custom b/gtk/Widget.custom index 7de486808..76b92b74d 100644 --- a/gtk/Widget.custom +++ b/gtk/Widget.custom @@ -44,12 +44,13 @@ protected override void CreateNativeObject (string[] names, GLib.Value[] vals) 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) - ParentedWidgets[this] = this; - else if (Parent == null && args.PreviousParent != null) - ParentedWidgets.Remove (this); + Widget w = o as Widget; + if (w.Parent != null && args.PreviousParent == null) + ParentedWidgets[w] = w; + else if (w.Parent == null && args.PreviousParent != null) + ParentedWidgets.Remove (w); } [DllImport("gtksharpglue-2")]