epiphany r8382 - in branches/gnome-2-24: embed src



Author: diegoe
Date: Mon Aug  4 13:23:07 2008
New Revision: 8382
URL: http://svn.gnome.org/viewvc/epiphany?rev=8382&view=rev

Log:
Move libnotify initialization to ephy-main

This should fix the crash when libnotify was uninit before the notification was
actually shown. Fix suggested by Colin Walters, closes: #536768.


Modified:
   branches/gnome-2-24/embed/downloader-view.c
   branches/gnome-2-24/src/ephy-main.c

Modified: branches/gnome-2-24/embed/downloader-view.c
==============================================================================
--- branches/gnome-2-24/embed/downloader-view.c	(original)
+++ branches/gnome-2-24/embed/downloader-view.c	Mon Aug  4 13:23:07 2008
@@ -141,11 +141,6 @@
 	object_class->finalize = downloader_view_finalize;
 
 	g_type_class_add_private (object_class, sizeof(DownloaderViewPrivate));
-
-#ifdef HAVE_LIBNOTIFY
-	notify_init (PACKAGE);
-#endif
-
 }
 
 static void
@@ -289,13 +284,6 @@
 
 	G_OBJECT_CLASS (downloader_view_parent_class)->finalize (object);
 
-#ifdef HAVE_LIBNOTIFY	
-	if (notify_is_initted ())
-	{
-		notify_uninit ();
-	}
-#endif
-
 	if (idle_unref)
 	{
 		ephy_object_idle_unref (embed_shell);

Modified: branches/gnome-2-24/src/ephy-main.c
==============================================================================
--- branches/gnome-2-24/src/ephy-main.c	(original)
+++ branches/gnome-2-24/src/ephy-main.c	Mon Aug  4 13:23:07 2008
@@ -50,6 +50,10 @@
 #include <errno.h>
 #include <string.h>
 
+#ifdef HAVE_LIBNOTIFY
+#include <libnotify/notify.h>
+#endif
+
 static GQuark startup_error_quark = 0;
 #define STARTUP_ERROR_QUARK	(startup_error_quark)
 
@@ -737,9 +741,18 @@
 	g_object_weak_ref (G_OBJECT (ephy_shell), shell_weak_notify, NULL);
 	ephy_object_idle_unref (ephy_shell);
 
+#ifdef HAVE_LIBNOTIFY	
+	/* Init notifications for the download manager */
+	notify_init (PACKAGE);
+#endif
+
 	gtk_main ();
 
 	/* Shutdown */
+#ifdef HAVE_LIBNOTIFY	
+	if (notify_is_initted ())
+		notify_uninit ();
+#endif
 	eel_gconf_monitor_remove ("/apps/epiphany/general");
 	gnome_accelerators_sync ();
 	ephy_state_save ();



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