diff options
Diffstat (limited to 'plugins/pychrysalide/format/symbol.c')
-rw-r--r-- | plugins/pychrysalide/format/symbol.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/pychrysalide/format/symbol.c b/plugins/pychrysalide/format/symbol.c index e2f2dda..d3a9c1e 100644 --- a/plugins/pychrysalide/format/symbol.c +++ b/plugins/pychrysalide/format/symbol.c @@ -157,7 +157,7 @@ static PyObject *py_binary_symbol_new(PyTypeObject *type, PyObject *args, PyObje if (first_time) { - status = register_class_for_dynamic_pygobject(gtype, type, base); + status = register_class_for_dynamic_pygobject(gtype, type); if (!status) { @@ -215,6 +215,7 @@ static void py_binary_symbol_init_gclass(GBinSymbolClass *class, gpointer unused static char *py_binary_symbol_get_label_wrapper(const GBinSymbol *symbol) { char *result; /* Etiquette à retourner */ + PyGILState_STATE gstate; /* Sauvegarde d'environnement */ PyObject *pyobj; /* Objet Python concerné */ PyObject *pyret; /* Bilan de consultation */ @@ -229,6 +230,8 @@ static char *py_binary_symbol_get_label_wrapper(const GBinSymbol *symbol) result = NULL; + gstate = PyGILState_Ensure(); + pyobj = pygobject_new(G_OBJECT(symbol)); if (has_python_method(pyobj, "_get_label")) @@ -247,6 +250,8 @@ static char *py_binary_symbol_get_label_wrapper(const GBinSymbol *symbol) Py_DECREF(pyobj); + PyGILState_Release(gstate); + return result; } @@ -977,7 +982,7 @@ bool ensure_python_binary_symbol_is_registered(void) if (!ensure_python_serializable_object_is_registered()) return false; - if (!register_class_for_pygobject(dict, G_TYPE_BIN_SYMBOL, type, &PyGObject_Type)) + if (!register_class_for_pygobject(dict, G_TYPE_BIN_SYMBOL, type)) return false; if (!define_binary_symbol_constants(type)) |