pidgin: 8966cd5e: Remove IO watches at shutdown in gntmain...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sun Aug 30 00:35:37 EDT 2009


-----------------------------------------------------------------
Revision: 8966cd5ef8503dd31312f866aaa4512cfc1fdf98
Ancestor: cbb83beca15a32e1008831042c03b602bba4f0e9
Author: desowin at gmail.com
Date: 2009-08-30T04:34:12
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/8966cd5ef8503dd31312f866aaa4512cfc1fdf98

Modified files:
        COPYRIGHT ChangeLog finch/libgnt/gntmain.c

ChangeLog: 

Remove IO watches at shutdown in gntmain.c  Closes #9872.

Patch from Tomasz "desowin" Mon.

-------------- next part --------------
============================================================
--- COPYRIGHT	dfc8e62b34734f33919dc152cb4b27a6416ef046
+++ COPYRIGHT	7bf3d16ae290ed74998994b7365751eaf9849a07
@@ -307,6 +307,7 @@ Andrew Molloy
 Arkadiusz Miskiewicz
 David Mohr
 Andrew Molloy
+Tomasz Mon
 Michael Monreal
 Laurent Montaron
 Marco Monteiro
============================================================
--- ChangeLog	d16f0351f46f5a877712ef82af938725bc0531ca
+++ ChangeLog	faacc1ca92b083af7e61cd7e464ea5316892f255
@@ -17,6 +17,7 @@ version 2.6.2 (??/??/2009):
 
 	Finch:
 	* Properly detect libpanel on OpenBSD.  (Brad Smith)
+	* Remove IO watches in gnt_quit.  (Tomasz Mon)
 
 	Pidgin:
 	* Fix the auto-personize functionality in the Buddy List.
============================================================
--- finch/libgnt/gntmain.c	bbbfd92b260bd321efb987edcacc0c27f7e35b9e
+++ finch/libgnt/gntmain.c	d61a9bb0e859f8155fb9ad4ba64372c9bc6d6042
@@ -69,7 +69,8 @@ static GIOChannel *channel = NULL;
  */
 
 static GIOChannel *channel = NULL;
-static int channel_read_callback;
+static guint channel_read_callback = 0;
+static guint channel_error_callback = 0;
 
 static gboolean ascii_only;
 static gboolean mouse_enabled;
@@ -314,11 +315,11 @@ setup_io()
 	channel_read_callback = result = g_io_add_watch_full(channel,  G_PRIORITY_HIGH,
 					(G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI),
 					io_invoke, NULL, NULL);
-	
-	g_io_add_watch_full(channel,  G_PRIORITY_HIGH,
+
+	channel_error_callback = g_io_add_watch_full(channel,  G_PRIORITY_HIGH,
 					(G_IO_NVAL),
 					io_invoke_error, GINT_TO_POINTER(result), NULL);
-	
+
 	g_io_channel_unref(channel);  /* Apparently this caused crashes for some people.
 	                                 But irssi does this, so I am going to assume the
 	                                 crashes were caused by some other stuff. */
@@ -583,6 +584,13 @@ void gnt_quit()
 
 void gnt_quit()
 {
+	/* Prevent io_invoke() from being called after wm is destroyed */
+	g_source_remove(channel_error_callback);
+	g_source_remove(channel_read_callback);
+
+	channel_error_callback = 0;
+	channel_read_callback = 0;
+
 	g_object_unref(G_OBJECT(wm));
 	wm = NULL;
 


More information about the Commits mailing list