1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Stop scripts when there's error in signal/timeout/input handler.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1694 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-07-31 01:22:32 +00:00 committed by cras
parent 642622624d
commit 137b3ae504

View File

@ -65,9 +65,11 @@ static void perl_script_destroy_package(PERL_SCRIPT_REC *script)
static void perl_script_destroy(PERL_SCRIPT_REC *script)
{
signal_emit("script destroyed", 1, script);
perl_scripts = g_slist_remove(perl_scripts, script);
perl_signal_remove_package(script->package);
signal_emit("script destroyed", 1, script);
perl_signal_remove_package(script->package);
perl_source_remove_package(script->package);
g_free(script->name);
@ -75,8 +77,6 @@ static void perl_script_destroy(PERL_SCRIPT_REC *script)
g_free_not_null(script->path);
g_free_not_null(script->data);
g_free(script);
perl_scripts = g_slist_remove(perl_scripts, script);
}
/* Initialize perl interpreter */
@ -349,10 +349,19 @@ static void perl_scripts_autorun(void)
g_free(path);
}
static void sig_script_error(PERL_SCRIPT_REC *script)
{
if (script != NULL) {
perl_script_destroy(script);
signal_stop();
}
}
void perl_core_init(void)
{
PL_perl_destruct_level = 1;
perl_signals_init();
signal_add_last("script error", (SIGNAL_FUNC) sig_script_error);
perl_scripts_init();
perl_scripts_autorun();
@ -362,4 +371,6 @@ void perl_core_deinit(void)
{
perl_signals_deinit();
perl_scripts_deinit();
signal_remove("script error", (SIGNAL_FUNC) sig_script_error);
}