changeset 6309:bf63ddea431f

[gaim-migrate @ 6808] Make Gaim not crash when you unload the system tray icon when there are messages queued. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 26 Jul 2003 18:05:25 +0000
parents a21cf07cd8e1
children f14718d7082e
files plugins/docklet/docklet.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/docklet/docklet.c	Sat Jul 26 17:48:50 2003 +0000
+++ b/plugins/docklet/docklet.c	Sat Jul 26 18:05:25 2003 +0000
@@ -54,6 +54,7 @@
 GaimPlugin *handle = NULL;
 static struct docklet_ui_ops *ui_ops = NULL;
 static enum docklet_status status = offline;
+static guint blinktimer = 0;
 #ifdef _WIN32
 __declspec(dllimport) GSList *unread_message_queue;
 __declspec(dllimport) GSList *away_messages;
@@ -263,7 +264,7 @@
 
 		/* and schedule the blinker function if messages are pending */
 		if (status == online_pending || status == away_pending) {
-			g_timeout_add(500, docklet_blink_icon, NULL);
+			blinktimer = g_timeout_add(500, docklet_blink_icon, NULL);
 		}
 	}
 
@@ -439,6 +440,9 @@
 static gboolean
 plugin_unload(GaimPlugin *plugin)
 {
+	if (blinktimer != 0)
+		g_source_remove(blinktimer);
+
 	if (ui_ops->destroy)
 		ui_ops->destroy();