comparison plugins/docklet/docklet.c @ 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 6b95da075de9
children f14718d7082e
comparison
equal deleted inserted replaced
6308:a21cf07cd8e1 6309:bf63ddea431f
52 /* globals */ 52 /* globals */
53 53
54 GaimPlugin *handle = NULL; 54 GaimPlugin *handle = NULL;
55 static struct docklet_ui_ops *ui_ops = NULL; 55 static struct docklet_ui_ops *ui_ops = NULL;
56 static enum docklet_status status = offline; 56 static enum docklet_status status = offline;
57 static guint blinktimer = 0;
57 #ifdef _WIN32 58 #ifdef _WIN32
58 __declspec(dllimport) GSList *unread_message_queue; 59 __declspec(dllimport) GSList *unread_message_queue;
59 __declspec(dllimport) GSList *away_messages; 60 __declspec(dllimport) GSList *away_messages;
60 __declspec(dllimport) struct away_message *awaymessage; 61 __declspec(dllimport) struct away_message *awaymessage;
61 __declspec(dllimport) GSList *message_queue; 62 __declspec(dllimport) GSList *message_queue;
261 if (ui_ops->update_icon) 262 if (ui_ops->update_icon)
262 ui_ops->update_icon(status); 263 ui_ops->update_icon(status);
263 264
264 /* and schedule the blinker function if messages are pending */ 265 /* and schedule the blinker function if messages are pending */
265 if (status == online_pending || status == away_pending) { 266 if (status == online_pending || status == away_pending) {
266 g_timeout_add(500, docklet_blink_icon, NULL); 267 blinktimer = g_timeout_add(500, docklet_blink_icon, NULL);
267 } 268 }
268 } 269 }
269 270
270 return FALSE; /* for when we're called by the glib idle handler */ 271 return FALSE; /* for when we're called by the glib idle handler */
271 } 272 }
437 } 438 }
438 439
439 static gboolean 440 static gboolean
440 plugin_unload(GaimPlugin *plugin) 441 plugin_unload(GaimPlugin *plugin)
441 { 442 {
443 if (blinktimer != 0)
444 g_source_remove(blinktimer);
445
442 if (ui_ops->destroy) 446 if (ui_ops->destroy)
443 ui_ops->destroy(); 447 ui_ops->destroy();
444 448
445 /* XXX: do this while gaim has no other way to toggle the global mute */ 449 /* XXX: do this while gaim has no other way to toggle the global mute */
446 gaim_gtk_sound_set_mute(FALSE); 450 gaim_gtk_sound_set_mute(FALSE);