summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/gtkext/displaypanel.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/gtkext/displaypanel.c')
-rw-r--r--plugins/pychrysa/gtkext/displaypanel.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/plugins/pychrysa/gtkext/displaypanel.c b/plugins/pychrysa/gtkext/displaypanel.c
index e857475..aa166e5 100644
--- a/plugins/pychrysa/gtkext/displaypanel.c
+++ b/plugins/pychrysa/gtkext/displaypanel.c
@@ -197,7 +197,7 @@ PyTypeObject *get_python_display_panel_type(void)
.tp_name = "pychrysalide.gtkext.DisplayPanel",
.tp_basicsize = sizeof(PyGObject),
- .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HEAPTYPE,
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
.tp_doc = "PyChrysalide view panel.",
@@ -211,12 +211,7 @@ PyTypeObject *get_python_display_panel_type(void)
static PyTypeObject *result = NULL;
if (result == NULL)
- {
- result = calloc(1, sizeof(PyTypeObject));
-
- memcpy(result, &py_display_panel_type, sizeof(PyTypeObject));
-
- }
+ result = define_python_dynamic_type(&py_display_panel_type);
return result;
@@ -248,7 +243,9 @@ bool register_python_display_panel(PyObject *module)
py_display_panel_type = get_python_display_panel_type();
parent_mod = PyImport_ImportModule("gi.repository.Gtk");
- if (parent_mod == NULL) return false;
+
+ if (parent_mod == NULL)
+ goto rpdp_exit;
fixed = PyObject_GetAttrString(parent_mod, "Fixed");
@@ -258,7 +255,6 @@ bool register_python_display_panel(PyObject *module)
result = register_class_for_pygobject(dict, GTK_TYPE_DISPLAY_PANEL,
py_display_panel_type, (PyTypeObject *)fixed);
-
Py_DECREF(fixed);
if (!result)