diff options
author | Timo Sirainen <cras@irssi.org> | 2001-08-08 22:43:00 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-08-08 22:43:00 +0000 |
commit | 2aaed8dc0b9fa6eec5370baf376beba645597392 (patch) | |
tree | 2d944969c6ed1190c9a9c3f4dfee72317b8397de | |
parent | 8a7fa0f047edcea09f51c22b31648eb744580340 (diff) | |
download | irssi-2aaed8dc0b9fa6eec5370baf376beba645597392.zip |
Irssi crashed if script died in a signal handler.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1730 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r-- | src/perl/perl-signals.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/perl/perl-signals.c b/src/perl/perl-signals.c index 9aa8d97a..52251177 100644 --- a/src/perl/perl-signals.c +++ b/src/perl/perl-signals.c @@ -163,7 +163,8 @@ static void perl_call_signal(const char *func, int signal_id, signal_emit("script error", 2, perl_script_find_package(package), SvPV(ERRSV, n_a)); - g_free(package); + g_free(package); + rec = NULL; } /* restore arguments the perl script modified */ @@ -210,15 +211,16 @@ static void perl_call_signal(const char *func, int signal_id, static void sig_func(int priority, gconstpointer *args) { - GSList **list, *tmp; + GSList **list, *tmp, *next; int signal_id; signal_id = signal_get_emitted_id(); list = g_hash_table_lookup(signals[priority], GINT_TO_POINTER(signal_id)); - for (tmp = list == NULL ? NULL : *list; tmp != NULL; tmp = tmp->next) { + for (tmp = list == NULL ? NULL : *list; tmp != NULL; tmp = next) { PERL_SIGNAL_REC *rec = tmp->data; + next = tmp->next; perl_call_signal(rec->func, signal_id, args); if (signal_is_stopped(signal_id)) break; |