summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/lua
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-08-17 12:53:34 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-08-17 12:53:34 +0200
commitdf69add9704b3b23bc650b8ea55bf13c3177dd77 (patch)
tree0e489fce058f6ff1d846df1d738e3947ee856ab5 /src/plugins/scripts/lua
parent168b1dd2b07207ad1771186a48cdebbda9e8527d (diff)
downloadweechat-df69add9704b3b23bc650b8ea55bf13c3177dd77.zip
scripts: fix crash with scripts not auto-loaded having a buffer opened after /upgrade (input/close callbacks for buffer not set properly)
Diffstat (limited to 'src/plugins/scripts/lua')
-rw-r--r--src/plugins/scripts/lua/weechat-lua.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c
index 32db149df..b555818fe 100644
--- a/src/plugins/scripts/lua/weechat-lua.c
+++ b/src/plugins/scripts/lua/weechat-lua.c
@@ -347,6 +347,16 @@ weechat_lua_load (const char *filename)
lua_current_script->interpreter = (lua_State *) lua_current_interpreter;
+ /*
+ * set input/close callbacks for buffers created by this script
+ * (to restore callbacks after upgrade)
+ */
+ script_set_buffer_callbacks (weechat_lua_plugin,
+ lua_scripts,
+ lua_current_script,
+ &weechat_lua_api_buffer_input_data_cb,
+ &weechat_lua_api_buffer_close_cb);
+
return 1;
}
@@ -724,16 +734,13 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
script_init (weechat_lua_plugin,
argc,
argv,
- &lua_scripts,
&weechat_lua_command_cb,
&weechat_lua_completion_cb,
&weechat_lua_infolist_cb,
&weechat_lua_signal_debug_dump_cb,
&weechat_lua_signal_buffer_closed_cb,
&weechat_lua_signal_script_action_cb,
- &weechat_lua_load_cb,
- &weechat_lua_api_buffer_input_data_cb,
- &weechat_lua_api_buffer_close_cb);
+ &weechat_lua_load_cb);
lua_quiet = 0;
script_display_short_list (weechat_lua_plugin,