1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-03 08:13:14 +02:00

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

This commit is contained in:
Sebastien Helleu
2012-06-10 22:31:29 +02:00
parent db43e2a018
commit 58918e2eeb
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -436,6 +436,7 @@ void
weechat_guile_unload (struct t_plugin_script *script)
{
int *rc;
void *interpreter;
if ((weechat_guile_plugin->debug >= 2) || !guile_quiet)
{
@@ -452,7 +453,7 @@ weechat_guile_unload (struct t_plugin_script *script)
free (rc);
}
weechat_guile_catch (scm_gc_unprotect_object, script->interpreter);
interpreter = script->interpreter;
if (guile_current_script == script)
guile_current_script = (guile_current_script->prev_script) ?
@@ -460,6 +461,9 @@ weechat_guile_unload (struct t_plugin_script *script)
script_remove (weechat_guile_plugin, &guile_scripts, &last_guile_script,
script);
if (interpreter)
weechat_guile_catch (scm_gc_unprotect_object, interpreter);
}
/*