From dcd5194f42a066d8f4f16d73abc82327fae430b0 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 3 Jul 2001 11:26:20 +0000 Subject: [Fixed #3643, Shell crash when component crashed] * e-shell-view.c (socket_destroy_cb): Fix Jason's broken fix for #3205 that was causing #3643. It is not safe to strcmp() the return value from `e_shell_view_get_current_uri()' as it might be NULL already. svn path=/trunk/; revision=10739 --- shell/ChangeLog | 9 +++++++++ shell/e-shell-view.c | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index a1aca471b4..644fdf6f0e 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,12 @@ +2001-07-03 Ettore Perazzoli + + [Fixed #3643, Shell crash when component crashed] + + * e-shell-view.c (socket_destroy_cb): Fix Jason's broken fix for + #3205 that was causing #3643. It is not safe to strcmp() the + return value from `e_shell_view_get_current_uri()' as it might be + NULL already. + 2001-07-02 Christopher James Lahey * Makefile.am (INCLUDES): Added $(BONOBO_CONF_CFLAGS). diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c index ae72420da6..8bfd90a163 100644 --- a/shell/e-shell-view.c +++ b/shell/e-shell-view.c @@ -1578,6 +1578,7 @@ socket_destroy_cb (GtkWidget *socket_widget, gpointer data) const char *uri; gboolean viewing_closed_uri; char *copy_of_uri; + const char *current_uri; shell_view = E_SHELL_VIEW (data); priv = shell_view->priv; @@ -1602,7 +1603,15 @@ socket_destroy_cb (GtkWidget *socket_widget, gpointer data) get_storage_set_path_from_uri (uri)); /* See if we were actively viewing the uri for the socket that's being closed */ - viewing_closed_uri = !strcmp (uri, e_shell_view_get_current_uri (shell_view)); + current_uri = e_shell_view_get_current_uri (shell_view); + if (current_uri == NULL) { + viewing_closed_uri = FALSE; + } else { + if (strcmp (uri, current_uri) == 0) + viewing_closed_uri = TRUE; + else + viewing_closed_uri = FALSE; + } if (viewing_closed_uri) e_shell_view_display_uri (shell_view, NULL); -- cgit