glib: Fix calling to Free() twice for the same ToggleRef

Apparently the recent changes in gtk-sharp master that changed
the destroy/dispose strategy caused a bug about calling
g_object_remove_toggle_ref() twice because now Dispose(true)
could call ToggleRef.Free() directly bypassing
ToggleRef.QueueUnref(). This change makes sure that
the ref is removed from the PendingDestroys list.
This commit is contained in:
Andres G. Aragoneses 2011-07-29 18:12:58 +01:00
parent c7657fcab4
commit 228a2b3da4

View file

@ -59,6 +59,10 @@ namespace GLib {
public void Free () public void Free ()
{ {
lock (PendingDestroys) {
PendingDestroys.Remove (this);
}
if (hardened) if (hardened)
g_object_unref (handle); g_object_unref (handle);
else else