mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
non-zero return value in timeout and input handlers now stops it.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2757 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
dbca752971
commit
0d76b65381
@ -64,6 +64,7 @@ static void perl_source_destroy(PERL_SOURCE_REC *rec)
|
||||
static int perl_source_event(PERL_SOURCE_REC *rec)
|
||||
{
|
||||
dSP;
|
||||
int retcount;
|
||||
|
||||
ENTER;
|
||||
SAVETMPS;
|
||||
@ -73,14 +74,18 @@ static int perl_source_event(PERL_SOURCE_REC *rec)
|
||||
PUTBACK;
|
||||
|
||||
perl_source_ref(rec);
|
||||
perl_call_sv(rec->func, G_EVAL|G_DISCARD);
|
||||
retcount = perl_call_sv(rec->func, G_EVAL|G_SCALAR);
|
||||
SPAGAIN;
|
||||
|
||||
if (SvTRUE(ERRSV)) {
|
||||
char *error = g_strdup(SvPV(ERRSV, PL_na));
|
||||
signal_emit("script error", 2, rec->script, error);
|
||||
g_free(error);
|
||||
} else if (retcount > 0 && POPi != 0) {
|
||||
/* stopped */
|
||||
perl_source_destroy(rec);
|
||||
}
|
||||
|
||||
perl_source_unref(rec);
|
||||
|
||||
PUTBACK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user