summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-02-02 22:51:38 +0100
committerSebastien Helleu <flashcode@flashtux.org>2011-02-02 22:51:38 +0100
commit372d9fe82ea829cd8cdc09a9f167508336852727 (patch)
tree6c68d18201022f5bb809d6a7217437f265317661
parent49da028a2c02a9243c69d6348d3934c7e3de9658 (diff)
downloadweechat-372d9fe82ea829cd8cdc09a9f167508336852727.zip
Fix crash when many lua scripts are executing callbacks at same time
-rw-r--r--ChangeLog3
-rw-r--r--src/plugins/scripts/lua/weechat-lua.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9a0831263..c3e1e2775 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
-v0.3.5-dev, 2011-02-01
+v0.3.5-dev, 2011-02-02
Version 0.3.5 (under dev!)
@@ -15,6 +15,7 @@ Version 0.3.5 (under dev!)
* core: allow background for nick colors (using "/")
* irc: add many missing commands for target buffer (options irc.msgbuffer.xxx)
(bug #32216)
+* lua: fix crash when many scripts are executing callbacks at same time
* xfer: do not close chat buffers when removing xfer from list (bug #32271)
Version 0.3.4 (2011-01-16)
diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c
index 3d3b2bcea..32db149df 100644
--- a/src/plugins/scripts/lua/weechat-lua.c
+++ b/src/plugins/scripts/lua/weechat-lua.c
@@ -151,8 +151,10 @@ weechat_lua_exec (struct t_plugin_script *script, int ret_type,
{
void *ret_value;
int argc, i, *ret_i;
+ lua_State *old_lua_current_interpreter;
struct t_plugin_script *old_lua_current_script;
+ old_lua_current_interpreter = lua_current_interpreter;
lua_current_interpreter = script->interpreter;
lua_getglobal (lua_current_interpreter, function);
@@ -191,6 +193,7 @@ weechat_lua_exec (struct t_plugin_script *script, int ret_type,
weechat_prefix ("error"), LUA_PLUGIN_NAME,
lua_tostring (lua_current_interpreter, -1));
lua_current_script = old_lua_current_script;
+ lua_current_interpreter = old_lua_current_interpreter;
return NULL;
}
@@ -212,10 +215,12 @@ weechat_lua_exec (struct t_plugin_script *script, int ret_type,
{
WEECHAT_SCRIPT_MSG_WRONG_ARGS(LUA_CURRENT_SCRIPT_NAME, function);
lua_current_script = old_lua_current_script;
+ lua_current_interpreter = old_lua_current_interpreter;
return NULL;
}
lua_current_script = old_lua_current_script;
+ lua_current_interpreter = old_lua_current_interpreter;
return ret_value;
}