mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 14:26:39 +02:00
guile: fix crash when unloading a script without pointer to interpreter
This commit is contained in:
@@ -15,6 +15,7 @@ Version 0.3.9 (under dev!)
|
||||
* core: reallow names beginning with "#" for bars, proxies and filters
|
||||
* core: escape special chars (`#[\`) in configuration files for name of options
|
||||
(bug #36584)
|
||||
* guile: fix crash when unloading a script without pointer to interpreter
|
||||
* 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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user