diff options
Diffstat (limited to 'plugins/pychrysalide/analysis/contents/restricted.c')
-rw-r--r-- | plugins/pychrysalide/analysis/contents/restricted.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/plugins/pychrysalide/analysis/contents/restricted.c b/plugins/pychrysalide/analysis/contents/restricted.c index f8b0b98..edd6666 100644 --- a/plugins/pychrysalide/analysis/contents/restricted.c +++ b/plugins/pychrysalide/analysis/contents/restricted.c @@ -35,6 +35,7 @@ #include "../content.h" +#include "../../access.h" #include "../../helpers.h" #include "../../arch/vmpa.h" @@ -155,18 +156,24 @@ PyTypeObject *get_python_restricted_content_type(void) * * ******************************************************************************/ -bool register_python_restricted_content(PyObject *module) +bool ensure_python_restricted_content_is_registered(void) { - PyTypeObject *py_restricted_content_type;/* Type Python 'BinContent' */ + PyTypeObject *type; /* Type Python 'Restricted...' */ + PyObject *module; /* Module à recompléter */ PyObject *dict; /* Dictionnaire du module */ - py_restricted_content_type = get_python_restricted_content_type(); + type = get_python_restricted_content_type(); - dict = PyModule_GetDict(module); + if (!PyType_HasFeature(type, Py_TPFLAGS_READY)) + { + module = get_access_to_python_module("pychrysalide.analysis.contents"); + + dict = PyModule_GetDict(module); - if (!register_class_for_pygobject(dict, G_TYPE_RESTRICTED_CONTENT, - py_restricted_content_type, &PyGObject_Type)) - return false; + if (!register_class_for_pygobject(dict, G_TYPE_RESTRICTED_CONTENT, type, &PyGObject_Type)) + return false; + + } return true; |