From 228a2b3da46e353f419b3f8fcdcdfc5097276cb5 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Fri, 29 Jul 2011 18:12:58 +0100 Subject: [PATCH] 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. --- glib/ToggleRef.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/glib/ToggleRef.cs b/glib/ToggleRef.cs index 9823038b4..bd2b996ce 100644 --- a/glib/ToggleRef.cs +++ b/glib/ToggleRef.cs @@ -59,6 +59,10 @@ namespace GLib { public void Free () { + lock (PendingDestroys) { + PendingDestroys.Remove (this); + } + if (hardened) g_object_unref (handle); else