summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/guile/weechat-guile.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2012-06-10 22:31:29 +0200
committerSebastien Helleu <flashcode@flashtux.org>2012-06-10 22:31:29 +0200
commit58918e2eeb6cbb1ac91ed2609a09f6581dd0f646 (patch)
treebf1210df69fe21d1162264413feac4a18b1e245e /src/plugins/scripts/guile/weechat-guile.c
parentdb43e2a018564e5df9eab078f4a5d13f8f1a193b (diff)
downloadweechat-58918e2eeb6cbb1ac91ed2609a09f6581dd0f646.zip
guile: fix crash when unloading a script without pointer to interpreter
Diffstat (limited to 'src/plugins/scripts/guile/weechat-guile.c')
-rw-r--r--src/plugins/scripts/guile/weechat-guile.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/scripts/guile/weechat-guile.c b/src/plugins/scripts/guile/weechat-guile.c
index 574d30849..aeb974646 100644
--- a/src/plugins/scripts/guile/weechat-guile.c
+++ b/src/plugins/scripts/guile/weechat-guile.c
@@ -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);
}
/*