summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-05-07 23:03:30 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-05-07 23:03:30 +0000
commit0d76b6538132e8baa793d5a199cc14cddcaf7593 (patch)
tree2cf0995462c54efd97487e59d10ce6705e7c97f7
parentdbca752971d78e18f4541f082192a33297706dd6 (diff)
downloadirssi-0d76b6538132e8baa793d5a199cc14cddcaf7593.zip
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
-rw-r--r--src/perl/perl-sources.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/perl/perl-sources.c b/src/perl/perl-sources.c
index be1a4188..06516474 100644
--- a/src/perl/perl-sources.c
+++ b/src/perl/perl-sources.c
@@ -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;