diff options
author | Diego Escalante Urrelo <diegoe@src.gnome.org> | 2008-08-04 21:21:11 +0800 |
---|---|---|
committer | Diego Escalante Urrelo <diegoe@src.gnome.org> | 2008-08-04 21:21:11 +0800 |
commit | 3c6a471e1ac91a23e98533bba0548c3a61ecc44d (patch) | |
tree | 5a2956edb456a9bdfa704d4a074fb6e8b9ef4e9e | |
parent | 666c60bb7f33b5288677e923a0ddadeea0cdc6f5 (diff) | |
download | gsoc2013-epiphany-3c6a471e1ac91a23e98533bba0548c3a61ecc44d.tar.gz gsoc2013-epiphany-3c6a471e1ac91a23e98533bba0548c3a61ecc44d.tar.zst gsoc2013-epiphany-3c6a471e1ac91a23e98533bba0548c3a61ecc44d.zip |
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.
svn path=/trunk/; revision=8380
-rw-r--r-- | embed/downloader-view.c | 12 | ||||
-rw-r--r-- | src/ephy-main.c | 13 |
2 files changed, 13 insertions, 12 deletions
diff --git a/embed/downloader-view.c b/embed/downloader-view.c index a5e59eed9..067477adc 100644 --- a/embed/downloader-view.c +++ b/embed/downloader-view.c @@ -138,11 +138,6 @@ downloader_view_class_init (DownloaderViewClass *klass) object_class->finalize = downloader_view_finalize; g_type_class_add_private (object_class, sizeof(DownloaderViewPrivate)); - -#ifdef HAVE_LIBNOTIFY - notify_init (PACKAGE); -#endif - } static void @@ -284,13 +279,6 @@ downloader_view_finalize (GObject *object) 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); diff --git a/src/ephy-main.c b/src/ephy-main.c index 0beebf939..1850ffbb4 100644 --- a/src/ephy-main.c +++ b/src/ephy-main.c @@ -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) @@ -714,9 +718,18 @@ main (int argc, 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 (); |