summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysalide/plugin.c')
-rw-r--r--plugins/pychrysalide/plugin.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/plugins/pychrysalide/plugin.c b/plugins/pychrysalide/plugin.c
index 6b6060d..44f518e 100644
--- a/plugins/pychrysalide/plugin.c
+++ b/plugins/pychrysalide/plugin.c
@@ -586,8 +586,14 @@ static bool g_python_plugin_read_interface(GPythonPlugin *plugin)
static bool g_python_plugin_do_init(GPythonPlugin *plugin)
{
bool result; /* Bilan à retourner */
+ PyThreadState *tstate; /* Contexte d'environnement */
PyObject *value; /* Valeur obtenue */
+ tstate = PyThreadState_Get();
+
+ if (tstate != NULL)
+ PyEval_RestoreThread(tstate);
+
if (!has_python_method(plugin->instance, "init"))
result = true;
@@ -601,6 +607,9 @@ static bool g_python_plugin_do_init(GPythonPlugin *plugin)
}
+ if (tstate != NULL)
+ PyEval_SaveThread();
+
return result;
}