summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/format/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/format/symbol.c')
-rw-r--r--plugins/pychrysalide/format/symbol.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/pychrysalide/format/symbol.c b/plugins/pychrysalide/format/symbol.c
index d6d6402..d3a9c1e 100644
--- a/plugins/pychrysalide/format/symbol.c
+++ b/plugins/pychrysalide/format/symbol.c
@@ -43,6 +43,7 @@
#include "../helpers.h"
#include "../analysis/routine.h"
#include "../analysis/db/items/comment.h"
+#include "../analysis/storage/serialize.h"
#include "../arch/instruction.h"
#include "../arch/vmpa.h"
#include "../glibext/linegen.h"
@@ -156,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)
{
@@ -214,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 */
@@ -228,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"))
@@ -246,6 +250,8 @@ static char *py_binary_symbol_get_label_wrapper(const GBinSymbol *symbol)
Py_DECREF(pyobj);
+ PyGILState_Release(gstate);
+
return result;
}
@@ -973,7 +979,10 @@ bool ensure_python_binary_symbol_is_registered(void)
if (!ensure_python_line_generator_is_registered())
return false;
- if (!register_class_for_pygobject(dict, G_TYPE_BIN_SYMBOL, type, &PyGObject_Type))
+ if (!ensure_python_serializable_object_is_registered())
+ return false;
+
+ if (!register_class_for_pygobject(dict, G_TYPE_BIN_SYMBOL, type))
return false;
if (!define_binary_symbol_constants(type))