From e4eaa198dd1224899c2a1f3d6887a143346c1908 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Sat, 13 Jan 2001 06:21:49 +0000 Subject: [PATCH] Unref our copy, and then destroy. 2001-01-13 Miguel de Icaza * e-shell.c (e_shell_construct): Unref our copy, and then destroy. * e-splash.c (e_splash_set_icon_highlight): Do not execute code if we have been destroyed. (e_splash_add_icon): ditto. svn path=/trunk/; revision=7475 --- shell/ChangeLog | 8 ++++++++ shell/e-shell.c | 4 ++++ shell/e-splash.c | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/shell/ChangeLog b/shell/ChangeLog index 42d672a98e..db830dbd71 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,11 @@ +2001-01-13 Miguel de Icaza + + * e-shell.c (e_shell_construct): Unref our copy, and then destroy. + + * e-splash.c (e_splash_set_icon_highlight): Do not execute code if + we have been destroyed. + (e_splash_add_icon): ditto. + 2001-01-12 Miguel de Icaza * e-splash.c (e_splash_construct): Ok, talked to Ettore. Going diff --git a/shell/e-shell.c b/shell/e-shell.c index 99be4848bf..95556a4528 100644 --- a/shell/e-shell.c +++ b/shell/e-shell.c @@ -710,6 +710,9 @@ e_shell_construct (EShell *shell, } else { splash = e_splash_new (); gtk_widget_show (splash); + + /* Keep our own reference */ + gtk_object_ref (GTK_OBJECT (splash)); } while (gtk_events_pending ()) @@ -753,6 +756,7 @@ e_shell_construct (EShell *shell, g_free (shortcut_path); sleep (2); + gtk_widget_unref (splash); gtk_widget_destroy (splash); return TRUE; diff --git a/shell/e-splash.c b/shell/e-splash.c index 33f5412455..3ecb10fa99 100644 --- a/shell/e-splash.c +++ b/shell/e-splash.c @@ -321,6 +321,7 @@ e_splash_construct (ESplash *splash, gtk_window_set_position (GTK_WINDOW (splash), GTK_WIN_POS_CENTER); gtk_window_set_policy (GTK_WINDOW (splash), FALSE, FALSE, FALSE); gtk_window_set_default_size (GTK_WINDOW (splash), image_width, image_height); + } /** @@ -369,6 +370,9 @@ e_splash_add_icon (ESplash *splash, g_return_val_if_fail (E_IS_SPLASH (splash), 0); g_return_val_if_fail (icon_pixbuf != NULL, 0); + if (GTK_OBJECT_DESTROYED (splash)) + return 0; + priv = splash->priv; icon = icon_new (splash, icon_pixbuf); @@ -400,6 +404,9 @@ e_splash_set_icon_highlight (ESplash *splash, g_return_if_fail (splash != NULL); g_return_if_fail (E_IS_SPLASH (splash)); + if (GTK_OBJECT_DESTROYED (splash)) + return; + priv = splash->priv; icon = (Icon *) g_list_nth (priv->icons, num)->data;