changeset 9893:8053a00136ea

[gaim-migrate @ 10781] " 1017153 crash on exit with message waiting(stacked) on the systray added gaim_signal_connect on "quitting" to do the docklet_flush_queue on quitting instead of plugin unload if gaim is quitting." --Fran??ois Gagn?? Date: 2004-08-27 17:24 Sender: datallahSourceForge.net Subscriber Logged In: YES user_id=325843 This is legitimate and should be applied to cvs, closing bug# 1017153. Date: 2004-08-27 17:23 Sender: frenchfrog Logged In: YES user_id=1013807 with permission of datallah im posting is (simplier) patch to the problem. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 28 Aug 2004 00:58:11 +0000
parents 284a84477ee9
children c774d62c0518
files plugins/docklet/docklet.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/docklet/docklet.c	Sat Aug 28 00:56:30 2004 +0000
+++ b/plugins/docklet/docklet.c	Sat Aug 28 00:58:11 2004 +0000
@@ -423,6 +423,14 @@
 	g_idle_add(docklet_update_status, &handle);
 }
 
+/* We need this because the blist purge_away_queue cb won't be called before the
+   plugin is unloaded, when quitting */
+static void gaim_quit_cb() {
+	gaim_debug(GAIM_DEBUG_INFO, "tray icon", "dealing with queued messages on exit\n");
+	docklet_flush_queue();
+}
+
+
 /* static void gaim_buddy_signon(GaimConnection *gc, char *who, void *data) {
 }
 
@@ -445,6 +453,7 @@
 	void *conn_handle = gaim_connections_get_handle();
 	void *conv_handle = gaim_conversations_get_handle();
 	void *accounts_handle = gaim_accounts_get_handle();
+	void *core_handle = gaim_get_core();
 
 	gaim_debug(GAIM_DEBUG_INFO, "tray icon", "plugin loaded\n");
 
@@ -467,6 +476,8 @@
 	gaim_signal_connect(conv_handle, "conversation-created",
 						plugin, GAIM_CALLBACK(gaim_new_conversation), NULL);
 
+	gaim_signal_connect(core_handle, "quitting",
+						plugin, GAIM_CALLBACK(gaim_quit_cb), NULL);
 /*	gaim_signal_connect(plugin, event_buddy_signon, gaim_buddy_signon, NULL);
 	gaim_signal_connect(plugin, event_buddy_signoff, gaim_buddy_signoff, NULL);
 	gaim_signal_connect(plugin, event_buddy_away, gaim_buddy_away, NULL);