aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-08-25 05:38:15 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-08-25 05:38:15 +0800
commit17a85e8669435d6ad7d1fafe507288fee88e8122 (patch)
treed0998d80ce2a74d3f7efa7adf6585674f76d53a3 /shell
parent277ddb9abe16ba5627f8979faac838ef988b8d3c (diff)
downloadgsoc2013-evolution-17a85e8669435d6ad7d1fafe507288fee88e8122.tar
gsoc2013-evolution-17a85e8669435d6ad7d1fafe507288fee88e8122.tar.gz
gsoc2013-evolution-17a85e8669435d6ad7d1fafe507288fee88e8122.tar.bz2
gsoc2013-evolution-17a85e8669435d6ad7d1fafe507288fee88e8122.tar.lz
gsoc2013-evolution-17a85e8669435d6ad7d1fafe507288fee88e8122.tar.xz
gsoc2013-evolution-17a85e8669435d6ad7d1fafe507288fee88e8122.tar.zst
gsoc2013-evolution-17a85e8669435d6ad7d1fafe507288fee88e8122.zip
Ooops. Save the pointer to the control for use after the view struct is
* e-shell-view.c (e_shell_view_remove_control_for_uri): Ooops. Save the pointer to the control for use after the view struct is freed. svn path=/trunk/; revision=12458
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog6
-rw-r--r--shell/e-shell-view.c17
2 files changed, 15 insertions, 8 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index c1df4d31b3..ea482e762e 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,11 @@
2001-08-24 Ettore Perazzoli <ettore@ximian.com>
+ * e-shell-view.c (e_shell_view_remove_control_for_uri): Ooops.
+ Save the pointer to the control for use after the view struct is
+ freed.
+
+2001-08-24 Ettore Perazzoli <ettore@ximian.com>
+
* e-shell-view.c: New struct `View'. Replace `uri_to_control' in
`EShellViewPrivate' with `uri_to_view'.
(view_new): New.
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 3654e31fe4..5f89f6a9a3 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -1996,6 +1996,7 @@ e_shell_view_remove_control_for_uri (EShellView *shell_view,
EShellViewPrivate *priv;
View *view;
GtkWidget *socket;
+ GtkWidget *control;
int page_num;
g_return_val_if_fail (shell_view != NULL, FALSE);
@@ -2005,25 +2006,25 @@ e_shell_view_remove_control_for_uri (EShellView *shell_view,
/* Get the control, remove it from our hash of controls */
view = g_hash_table_lookup (priv->uri_to_view, uri);
- if (view != NULL) {
- view_destroy (view);
- g_hash_table_remove (priv->uri_to_view, uri);
- } else {
+ if (view == NULL)
return FALSE;
- }
+
+ control = view->control;
+ view_destroy (view);
+ g_hash_table_remove (priv->uri_to_view, uri);
/* Get the socket, remove it from our list of sockets */
- socket = find_socket (GTK_CONTAINER (view->control));
+ socket = find_socket (GTK_CONTAINER (control));
priv->sockets = g_list_remove (priv->sockets, socket);
/* Remove the notebook page */
- page_num = gtk_notebook_page_num (GTK_NOTEBOOK (priv->notebook), view->control);
+ page_num = gtk_notebook_page_num (GTK_NOTEBOOK (priv->notebook), control);
gtk_notebook_remove_page (GTK_NOTEBOOK (priv->notebook), page_num);
/* Destroy things, socket first because otherwise shell will
think the control crashed */
gtk_widget_destroy (socket);
- gtk_widget_destroy (view->control);
+ gtk_widget_destroy (control);
return TRUE;
}