diff --git a/ChangeLog b/ChangeLog index 4ab62d45b..66c5e763b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ Version 0.3.9 (under dev!) * guile: fix path of guile include dirs in cmake build (patch #7790) * irc: fix freeze when reading on socket with SSL enabled (bug #35097) * irc: reallow names beginning with "#" for servers +* python: fix crash when unloading a script without pointer to interpreter Version 0.3.8 (2012-06-03) -------------------------- diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c index 9441b89c0..164de77c9 100644 --- a/src/plugins/scripts/python/weechat-python.c +++ b/src/plugins/scripts/python/weechat-python.c @@ -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);