649f9060d84e5d0c93006e775e3b9e07624485de
diff --git a/gi/gimodule.c b/gi/gimodule.c
index 8650fb3..a6f01aa 100644
--- a/gi/gimodule.c
+++ b/gi/gimodule.c
@@ -220,6 +220,13 @@ _wrap_pyg_hook_up_vfunc_implementation (PyObject *self, PyObject *args)
     Py_RETURN_NONE;
 }
 
+static void
+_sink_gobject(GObject *obj)
+{
+	if (G_IS_INITIALLY_UNOWNED(obj) || g_object_is_floating(obj)) {
+	        g_object_ref_sink(obj);
+	}
+}
 
 static PyMethodDef _pygi_functions[] = {
     { "enum_add", (PyCFunction)_wrap_pyg_enum_add, METH_VARARGS | METH_KEYWORDS },
@@ -259,6 +266,11 @@ init_gi(void)
     if (Pycairo_CAPI == NULL)
         return;
 
+    // register our floating object sink while we wait for the pygobject
+    // patch to be approved.  Once the patch is in this becomes a noop
+    // For more details - https://bugzilla.gnome.org/show_bug.cgi?id=583909
+    pygobject_register_sinkfunc(G_TYPE_OBJECT, _sink_gobject);
+
     _pygi_repository_register_types(m);
     _pygi_info_register_types(m);
     _pygi_struct_register_types(m);
