mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 04:46:37 +02:00
Fix bug with current script pointer when current script is unloaded
This commit is contained in:
@@ -294,6 +294,10 @@ weechat_lua_unload (struct t_plugin_script *script)
|
||||
|
||||
interpreter = script->interpreter;
|
||||
|
||||
if (lua_current_script == script)
|
||||
lua_current_script = (lua_current_script->prev_script) ?
|
||||
lua_current_script->prev_script : lua_current_script->next_script;
|
||||
|
||||
script_remove (weechat_lua_plugin, &lua_scripts, script);
|
||||
|
||||
lua_close (script->interpreter);
|
||||
|
||||
@@ -432,6 +432,10 @@ weechat_perl_unload (struct t_plugin_script *script)
|
||||
|
||||
interpreter = script->interpreter;
|
||||
|
||||
if (perl_current_script == script)
|
||||
perl_current_script = (perl_current_script->prev_script) ?
|
||||
perl_current_script->prev_script : perl_current_script->next_script;
|
||||
|
||||
script_remove (weechat_perl_plugin, &perl_scripts, script);
|
||||
|
||||
#ifdef MULTIPLICITY
|
||||
|
||||
@@ -505,6 +505,10 @@ weechat_python_unload (struct t_plugin_script *script)
|
||||
|
||||
interpreter = script->interpreter;
|
||||
|
||||
if (python_current_script == script)
|
||||
python_current_script = (python_current_script->prev_script) ?
|
||||
python_current_script->prev_script : python_current_script->next_script;
|
||||
|
||||
script_remove (weechat_python_plugin, &python_scripts, script);
|
||||
|
||||
PyThreadState_Swap (interpreter);
|
||||
|
||||
@@ -491,6 +491,10 @@ weechat_ruby_unload (struct t_plugin_script *script)
|
||||
|
||||
interpreter = script->interpreter;
|
||||
|
||||
if (ruby_current_script == script)
|
||||
ruby_current_script = (ruby_current_script->prev_script) ?
|
||||
ruby_current_script->prev_script : ruby_current_script->next_script;
|
||||
|
||||
script_remove (weechat_ruby_plugin, &ruby_scripts, script);
|
||||
|
||||
if (interpreter)
|
||||
|
||||
@@ -235,6 +235,10 @@ weechat_tcl_unload (struct t_plugin_script *script)
|
||||
|
||||
interp = (Tcl_Interp*)script->interpreter;
|
||||
|
||||
if (tcl_current_script == script)
|
||||
tcl_current_script = (tcl_current_script->prev_script) ?
|
||||
tcl_current_script->prev_script : tcl_current_script->next_script;
|
||||
|
||||
script_remove (weechat_tcl_plugin, &tcl_scripts, script);
|
||||
|
||||
Tcl_DeleteInterp(interp);
|
||||
|
||||
Reference in New Issue
Block a user