diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2023-09-14 07:10:15 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2023-09-14 07:10:15 (GMT) |
commit | bec97699f21d4dadcdc1a9f26985c699a374655d (patch) | |
tree | 092d98dd7d9e1bc7bd3c884a91d69b3ba58aef1d | |
parent | f2f0fc476e032ada5460f251aace7878e1cd3934 (diff) |
Handle Python bad plugins without name.
-rw-r--r-- | plugins/pychrysalide/plugins/plugin.c | 2 | ||||
-rw-r--r-- | src/plugins/plugin.c | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/plugins/pychrysalide/plugins/plugin.c b/plugins/pychrysalide/plugins/plugin.c index 2488d21..340c617 100644 --- a/plugins/pychrysalide/plugins/plugin.c +++ b/plugins/pychrysalide/plugins/plugin.c @@ -579,6 +579,8 @@ static char *py_plugin_module_get_modname_wrapper(const GPluginModule *plugin) " script filename." \ ) + result = NULL; + gstate = PyGILState_Ensure(); pyobj = pygobject_new(G_OBJECT(plugin)); diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c index 0281617..b96decd 100644 --- a/src/plugins/plugin.c +++ b/src/plugins/plugin.c @@ -820,6 +820,15 @@ char *g_plugin_module_get_modname(const GPluginModule *plugin) result = class->get_modname(plugin); + /** + * Tente une opération de la dernière chance. + * + * Dans le cas d'un module Python, la fonction de classe peut ne pas + * trouver de support si l'extension Python n'est pas au point. + */ + if (result == NULL && class->get_modname != _g_plugin_module_get_modname) + result = _g_plugin_module_get_modname(plugin); + return result; } |