diff options
| author | Cyrille Bagard <nocbos@gmail.com> | 2020-05-19 22:38:17 (GMT) | 
|---|---|---|
| committer | Cyrille Bagard <nocbos@gmail.com> | 2020-05-19 22:38:17 (GMT) | 
| commit | 5d09d85a5e606e5ac458abd37e72b73ce52541cb (patch) | |
| tree | 9e9bd0581cc433fc7d8392a137b5a83dc46a9098 /plugins/pychrysalide/plugin.c | |
| parent | 93b452d5258aa07d24ec233f2de930343be1d974 (diff) | |
Improved the use of the known format object.
Diffstat (limited to 'plugins/pychrysalide/plugin.c')
| -rw-r--r-- | plugins/pychrysalide/plugin.c | 7 | 
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/pychrysalide/plugin.c b/plugins/pychrysalide/plugin.c index 0d24f8c..208c46a 100644 --- a/plugins/pychrysalide/plugin.c +++ b/plugins/pychrysalide/plugin.c @@ -676,6 +676,7 @@ static void py_plugin_module_handle_loaded_content_wrapper(const GPluginModule *  static bool py_plugin_module_handle_binary_format_analysis_wrapper(const GPluginModule *plugin, PluginAction action, GBinFormat *format, wgroup_id_t gid, GtkStatusStack *status)  { +    bool result;                            /* Bilan à retourner           */      PyGILState_STATE gstate;                /* Sauvegarde d'environnement  */      PyObject *pyobj;                        /* Objet Python concerné       */      PyObject *args;                         /* Arguments pour l'appel      */ @@ -701,6 +702,8 @@ static bool py_plugin_module_handle_binary_format_analysis_wrapper(const GPlugin      " *FORMAT_POST_ANALYSIS_STARTED* or *FORMAT_POST_ANALYSIS_ENDED*."              \  ) +    result = false; +      gstate = PyGILState_Ensure();      pyobj = pygobject_new(G_OBJECT(plugin)); @@ -716,6 +719,8 @@ static bool py_plugin_module_handle_binary_format_analysis_wrapper(const GPlugin          pyret = run_python_method(pyobj, "_handle_format_analysis", args); +        result = (pyret == Py_True); +          Py_XDECREF(pyret);          Py_DECREF(args); @@ -725,7 +730,7 @@ static bool py_plugin_module_handle_binary_format_analysis_wrapper(const GPlugin      PyGILState_Release(gstate); -    return true; +    return result;  }  | 
