diff options
author | Zander Brown <zbrown@gnome.org> | 2022-07-26 16:31:12 +0100 |
---|---|---|
committer | Zander Brown <zbrown@gnome.org> | 2022-07-26 16:31:12 +0100 |
commit | ca3b2c52dab5114e413cc839f57c62ac8968f67a (patch) | |
tree | ea75785df3c610098a158b6fbbbb22031bd14e9b | |
parent | d8473a16733377b74681b8a8e913b017cdc053d6 (diff) | |
download | gobject-introspection-zbrown/dispose.tar.gz |
whateverzbrown/dispose
-rw-r--r-- | gi/gimodule.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/gi/gimodule.c b/gi/gimodule.c index 9066b9ee..07440086 100644 --- a/gi/gimodule.c +++ b/gi/gimodule.c @@ -942,7 +942,14 @@ pyg_object_dispose (GObject *object) { PyObject *object_wrapper, *retval; PyGILState_STATE state; - GObjectClass *parent_class = g_type_class_peek (g_type_parent (G_TYPE_FROM_CLASS (object))); + GType parent = g_type_parent (G_TYPE_FROM_INSTANCE (object)); + GObjectClass *parent_class = g_type_class_peek (parent); + + printf ("dispose (%p) %20s %20s %p\n", + object, + G_OBJECT_TYPE_NAME (object), + g_type_name (parent), + parent_class); state = PyGILState_Ensure(); @@ -954,14 +961,14 @@ pyg_object_dispose (GObject *object) object_wrapper = pygobject_new(object); if (object_wrapper == NULL) { - PyGILState_Release(state); - return; + PyGILState_Release(state); + return; } retval = PyObject_CallMethod(object_wrapper, "do_dispose", NULL); if (retval) { - Py_DECREF(retval); + Py_DECREF(retval); } else { - PyErr_Print(); + PyErr_Print(); } // Chain up the dispose call if (parent_class->dispose) { |