1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-02 15:53:12 +02:00

scripts: fix crash with scripts not auto-loaded having a buffer opened after /upgrade (input/close callbacks for buffer not set properly)

This commit is contained in:
Sebastien Helleu
2011-08-17 12:53:34 +02:00
parent 168b1dd2b0
commit df69add970
8 changed files with 167 additions and 147 deletions
+11 -4
View File
@@ -582,6 +582,16 @@ weechat_ruby_load (const char *filename)
ruby_current_script->interpreter = (VALUE *) curModule;
rb_gc_register_address (ruby_current_script->interpreter);
/*
* set input/close callbacks for buffers created by this script
* (to restore callbacks after upgrade)
*/
script_set_buffer_callbacks (weechat_ruby_plugin,
ruby_scripts,
ruby_current_script,
&weechat_ruby_api_buffer_input_data_cb,
&weechat_ruby_api_buffer_close_cb);
return 1;
}
@@ -1059,16 +1069,13 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
script_init (weechat_ruby_plugin,
argc,
argv,
&ruby_scripts,
&weechat_ruby_command_cb,
&weechat_ruby_completion_cb,
&weechat_ruby_infolist_cb,
&weechat_ruby_signal_debug_dump_cb,
&weechat_ruby_signal_buffer_closed_cb,
&weechat_ruby_signal_script_action_cb,
&weechat_ruby_load_cb,
&weechat_ruby_api_buffer_input_data_cb,
&weechat_ruby_api_buffer_close_cb);
&weechat_ruby_load_cb);
ruby_quiet = 0;
script_display_short_list (weechat_ruby_plugin,