1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

python: fix crash when unloading a script without pointer to interpreter

This commit is contained in:
Sebastien Helleu
2012-06-10 22:30:48 +02:00
parent bab252de96
commit db43e2a018
2 changed files with 6 additions and 2 deletions
+5 -2
View File
@@ -792,8 +792,11 @@ weechat_python_unload (struct t_plugin_script *script)
script_remove (weechat_python_plugin, &python_scripts, &last_python_script,
script);
PyThreadState_Swap (interpreter);
Py_EndInterpreter (interpreter);
if (interpreter)
{
PyThreadState_Swap (interpreter);
Py_EndInterpreter (interpreter);
}
if (old_interpreter)
PyThreadState_Swap (old_interpreter);