md5=e0bc5b08d467cc3763550923087772d3
sha256=f77cda95fa7cea5e7ad189ac18a165bb3886a66bc5f97c6398a9e5dc16c8a671
+[http://ftp.gnome.org/pub/GNOME/sources/glib/2.22/glib-2.22.1.tar.bz2]
+md5=12297a7da577321647b38ade0593cb3c
+sha256=4898d340c830a5903115412ec5b95eb03b410efdfb1c5316d36f12f8be85577d
+
[ftp://ftp.gtk.org/pub/gtk/v2.4/glib-2.4.6.tar.bz2]
md5=a45db7d82480da431f6cd00ea041a534
sha256=d2ca79bac06a625d9276b48492c2c1caccf7f8962f9b331b39796391013e72f2
--- /dev/null
+https://bugzilla.gnome.org/show_bug.cgi?id=556515 - g_object_unref race condition
+
+
+diff --git /tmp/gobject.c glib-2.21.6/gobject/gobject.c
+index 454d8c2..75f479c 100644
+--- /tmp/gobject.c
++++ glib-2.21.6/gobject/gobject.c
+@@ -2380,11 +2380,12 @@ g_object_unref (gpointer _object)
+ old_ref = g_atomic_int_get (&object->ref_count);
+ if (old_ref > 1)
+ {
++ gboolean do_toggle_ref_notify = (old_ref == 2 && OBJECT_HAS_TOGGLE_REF (object));
+ if (!g_atomic_int_compare_and_exchange ((int *)&object->ref_count, old_ref, old_ref - 1))
+ goto retry_atomic_decrement1;
+
+ /* if we went from 2->1 we need to notify toggle refs if any */
+- if (old_ref == 2 && OBJECT_HAS_TOGGLE_REF (object))
++ if (do_toggle_ref_notify)
+ toggle_refs_notify (object, TRUE);
+ }
+ else
+@@ -2397,11 +2398,12 @@ g_object_unref (gpointer _object)
+ old_ref = g_atomic_int_get ((int *)&object->ref_count);
+ if (old_ref > 1)
+ {
++ gboolean do_toggle_ref_notify = (old_ref == 2 && OBJECT_HAS_TOGGLE_REF (object));
+ if (!g_atomic_int_compare_and_exchange ((int *)&object->ref_count, old_ref, old_ref - 1))
+ goto retry_atomic_decrement2;
+
+ /* if we went from 2->1 we need to notify toggle refs if any */
+- if (old_ref == 2 && OBJECT_HAS_TOGGLE_REF (object))
++ if (do_toggle_ref_notify)
+ toggle_refs_notify (object, TRUE);
+
+ return;