[patch] fix up behavior on panel crash



Dan,

It looks like we try to gracefully handle panel crashes (we catch the
destroy signal, etc.) but we don't.

Three problems:

	- The GtkWindow is already gone by the time we call
	  nmwa_destroy, generating warnings.
	- g_thread_join() fails because the dbus thread is not
	  joinable.
	- We never actually exit.

Don't know how to fix the first thing, or if we want to.

The second is fixed by either not waiting on the thread, or making the
thread joinable.   Since it makes sense to wait for the thread to die
(and if we do wait, it will die), we should make the thread joinable and
then wait on it.  One-line patch.

The third is fixed by simply calling exit() at the end of
nmwa_destroy().  This seems right, but are we supposed to die through
some other implicit method?

Patch is attached.

With it, we successfully regenerate (via session management) when the
panel dies.

Look right?  May I commit?

	Robert Love

 gnome/applet/applet.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

Index: gnome/applet/applet.c
===================================================================
RCS file: /cvs/gnome/NetworkManager/gnome/applet/applet.c,v
retrieving revision 1.27
diff -u -r1.27 applet.c
--- gnome/applet/applet.c	5 Aug 2005 18:58:16 -0000	1.27
+++ gnome/applet/applet.c	9 Aug 2005 20:04:31 -0000
@@ -2391,6 +2391,8 @@
 	gconf_client_notify_remove (applet->gconf_client, applet->gconf_prefs_notify_id);
 	gconf_client_notify_remove (applet->gconf_client, applet->gconf_vpn_notify_id);
 	g_object_unref (G_OBJECT (applet->gconf_client));
+
+	exit (EXIT_SUCCESS);
 }
 
 
@@ -2455,7 +2457,7 @@
 		g_object_unref (G_OBJECT (applet->gconf_client));
 		return NULL;
 	}
-	if (!(applet->dbus_thread = g_thread_create (nmwa_dbus_worker, applet, FALSE, &error)))
+	if (!(applet->dbus_thread = g_thread_create (nmwa_dbus_worker, applet, TRUE, &error)))
 	{
 		g_mutex_free (applet->data_mutex);
 		g_object_unref (G_OBJECT (applet->gconf_client));


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