summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/gtkext/displaypanel.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-08-12 15:08:53 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-08-12 15:08:53 (GMT)
commitfcc78751e1e733b8662fde7d5e8ac6023cb34582 (patch)
treed57096d898446b6c2387bd2bd7ead0d3f175b617 /plugins/pychrysa/gtkext/displaypanel.c
parenta9328553fc558bca2e75f2c93b35acc5518d9568 (diff)
Fixed many mistakes in the Python bindings.
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)