[pygobject] Revert "correctly handle floating objects in gtk"



commit 8b3a3baacb45cb3f9112f7597607602fa89c6634
Author: Tomeu Vizoso <tomeu vizoso collabora co uk>
Date:   Fri Jun 25 13:54:57 2010 +0200

    Revert "correctly handle floating objects in gtk"
    
    This reverts commit 60fdf4b8f738dd0f5c190bc18ddf010032d3c5ca.
    
    Conflicts:
    
    	gi/gimodule.c
    	tests/test_everything.py

 gi/gimodule.c            |   13 -------------
 tests/test_everything.py |    3 ++-
 2 files changed, 2 insertions(+), 14 deletions(-)
---
diff --git a/gi/gimodule.c b/gi/gimodule.c
index 59601fb..0375825 100644
--- a/gi/gimodule.c
+++ b/gi/gimodule.c
@@ -231,14 +231,6 @@ _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 },
     { "flags_add", (PyCFunction) _wrap_pyg_flags_add, METH_VARARGS | METH_KEYWORDS },
@@ -277,11 +269,6 @@ 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);
diff --git a/tests/test_everything.py b/tests/test_everything.py
index c7c0385..69d1954 100644
--- a/tests/test_everything.py
+++ b/tests/test_everything.py
@@ -121,6 +121,7 @@ class TestNullableArgs(unittest.TestCase):
     def test_out_nullable_object(self):
         self.assertEqual(None, Everything.test_object_null_out())
 
+
 class TestCallbacks(unittest.TestCase):
     called = False
     main_loop = GObject.MainLoop()
@@ -270,4 +271,4 @@ class TestCallbacks(unittest.TestCase):
 
     def testCallbackNone(self):
         # make sure this doesn't assert or crash
-        Everything.test_simple_callback(None)
\ No newline at end of file
+        Everything.test_simple_callback(None)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]