changeset 18092:662564beb575

Make timeout-callbacks behave like they would in C plugins (ie. the callback is not removed until it returns FALSE).
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Wed, 13 Jun 2007 08:07:06 +0000
parents 7e0bd339533c
children c0a09c56d0c5
files libpurple/plugins/perl/perl-handlers.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/perl/perl-handlers.c	Tue Jun 12 21:25:56 2007 +0000
+++ b/libpurple/plugins/perl/perl-handlers.c	Wed Jun 13 08:07:06 2007 +0000
@@ -214,6 +214,7 @@
 perl_timeout_cb(gpointer data)
 {
 	PurplePerlTimeoutHandler *handler = (PurplePerlTimeoutHandler *)data;
+	gboolean ret = FALSE;
 
 	dSP;
 	ENTER;
@@ -224,16 +225,16 @@
 	call_sv(handler->callback, G_EVAL | G_SCALAR);
 	SPAGAIN;
 
+	ret = POPi;
+
 	PUTBACK;
 	FREETMPS;
 	LEAVE;
 
-	/* We're returning FALSE, so no need to manually remove the source */
-	handler->iotag = 0;
+	if (ret == FALSE)
+		destroy_timeout_handler(handler);
 
-	destroy_timeout_handler(handler);
-
-	return FALSE;
+	return ret;
 }
 
 typedef void *DATATYPE;