NetworkManager r4126 - in trunk: . src



Author: dcbw
Date: Tue Sep 30 16:48:16 2008
New Revision: 4126
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=4126&view=rev

Log:
2008-09-30  Dan Williams  <dcbw redhat com>

	* src/NetworkManagerPolicy.c
		- (lookup_thread_worker): don't store the idle handler ID becuase the
			idle handler could have already run and freed the LookupThread
			structure



Modified:
   trunk/ChangeLog
   trunk/src/NetworkManagerPolicy.c

Modified: trunk/src/NetworkManagerPolicy.c
==============================================================================
--- trunk/src/NetworkManagerPolicy.c	(original)
+++ trunk/src/NetworkManagerPolicy.c	Tue Sep 30 16:48:16 2008
@@ -58,7 +58,6 @@
 	guint32 ip4_addr;
 	char hostname[NI_MAXHOST + 1];
 
-	guint done_id;
 	LookupCallback callback;
 	gpointer user_data;
 };
@@ -110,7 +109,11 @@
 			thread->hostname[i] = tolower (thread->hostname[i]);
 	}
 
-	thread->done_id = g_idle_add (lookup_thread_run_cb, thread);
+	/* Don't track the idle handler ID because by the time the g_idle_add()
+	 * returns the ID, the handler may already have run and freed the
+	 * LookupThread.
+	 */
+	g_idle_add (lookup_thread_run_cb, thread);
 	return (gpointer) TRUE;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]