[Gtk-sharp-list] SubWidget problems

Dan Winship danw@novell.com
Thu, 16 Dec 2004 10:01:46 -0500

On Wed, 2004-12-15 at 21:07 -0800, Alex Graveley wrote:
> How is Gtk# 2.0 fixing this?

For fully-managed widgets (ie, widgets that aren't just wrappers created
by gapi), Gtk# connects to their "ParentSet" event at creation time, and
then whenever the widget's Parent is non-null, Gtk# keeps a reference to
the widget in a static hash table to keep it from being GCed.

So this doesn't generically solve the problem of unmanaged code holding
references to managed objects, but it fixes the biggest case (and we
could add similar hacks for other cases if we needed to).

-- Dan