libpurple/plugins/perl/perl-handlers.c

changeset 16140
362e0ca15d3a
parent 15884
4de1981757fc
child 16238
33bf2fd32108
child 17570
4cca2fc0ec83
child 18068
b6554e3c8224
child 20478
46933dc62880
--- a/libpurple/plugins/perl/perl-handlers.c	Fri Apr 13 01:57:16 2007 +0000
+++ b/libpurple/plugins/perl/perl-handlers.c	Fri Apr 13 02:37:56 2007 +0000
@@ -183,6 +183,9 @@
 {
 	timeout_handlers = g_list_remove(timeout_handlers, handler);
 
+	if (handler->iotag > 0)
+		g_source_remove(handler->iotag);
+
 	if (handler->callback != NULL)
 		SvREFCNT_dec(handler->callback);
 
@@ -207,7 +210,7 @@
 	g_free(handler);
 }
 
-static int
+static gboolean
 perl_timeout_cb(gpointer data)
 {
 	PurplePerlTimeoutHandler *handler = (PurplePerlTimeoutHandler *)data;
@@ -225,9 +228,12 @@
 	FREETMPS;
 	LEAVE;
 
+	/* We're returning FALSE, so no need to manually remove the source */
+	handler->iotag = 0;
+
 	destroy_timeout_handler(handler);
 
-	return 0;
+	return FALSE;
 }
 
 typedef void *DATATYPE;

mercurial