glib: Remove redundant call to ToggleRef.QueueUnref()

In slow systems this redundant call was causing the following CRITICAL:

  GLib-GObject-CRITICAL **: g_object_remove_toggle_ref:
    assertion `G_IS_OBJECT (object)' failed

The GLib.Object.Dispose(bool) method already calls this function at the
end so there is no need to check for duplicates in the PendingDestroys
static field of ToggleRef class (thanks to Alan McGorvern for helping
tracking down the root cause), the double unref call is just prevented.

Fixes BXC#4909.
This commit is contained in:
Andrés G. Aragoneses 2012-05-08 20:35:36 +01:00
parent a446117715
commit 85b84f99f6

View file

@ -60,7 +60,6 @@ namespace GLib {
ToggleRef tref; ToggleRef tref;
lock (Objects) { lock (Objects) {
if (Objects.TryGetValue (Handle, out tref)) { if (Objects.TryGetValue (Handle, out tref)) {
tref.QueueUnref ();
Objects.Remove (Handle); Objects.Remove (Handle);
} }
} }