aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-09-18 05:57:33 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-09-18 05:57:33 +0800
commit1e050bd5f7793b68b997095aab38359e45216c1a (patch)
treebfefe729d6acb85ab33dc6d99163adbfc6ee36ea
parent1cca3628386aa66324f4e407e73e761d379b64b3 (diff)
downloadgsoc2013-evolution-1e050bd5f7793b68b997095aab38359e45216c1a.tar.gz
gsoc2013-evolution-1e050bd5f7793b68b997095aab38359e45216c1a.tar.zst
gsoc2013-evolution-1e050bd5f7793b68b997095aab38359e45216c1a.zip
[Fix #9060, Shell crash after mailer crash.]
* e-shell-view.c (hash_foreach_destroy_view): Renamed from `hash_forall_destroy_view'. Don't free `name'. (socket_destroy_cb): Use `g_hash_table_lookup()' instead of `g_hash_table_lookup_extended()'. Don't free the URI. (e_shell_view_remove_control_for_uri): Likewise. (show_existing_view): Use view->uri as the key when inserting the view. Remove the old view from the hash when destroying it. (create_new_view_for_uri): Same here. svn path=/trunk/; revision=12913
-rw-r--r--shell/ChangeLog13
-rw-r--r--shell/e-shell-view.c37
2 files changed, 26 insertions, 24 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index d0a785676f..59e5929c19 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,16 @@
+2001-09-17 Ettore Perazzoli <ettore@ximian.com>
+
+ [Fix #9060, Shell crash after mailer crash.]
+
+ * e-shell-view.c (hash_foreach_destroy_view): Renamed from
+ `hash_forall_destroy_view'. Don't free `name'.
+ (socket_destroy_cb): Use `g_hash_table_lookup()' instead of
+ `g_hash_table_lookup_extended()'. Don't free the URI.
+ (e_shell_view_remove_control_for_uri): Likewise.
+ (show_existing_view): Use view->uri as the key when inserting the
+ view. Remove the old view from the hash when destroying it.
+ (create_new_view_for_uri): Same here.
+
2001-09-16 Ettore Perazzoli <ettore@ximian.com>
* e-shell-view.c (e_shell_view_show_folder_bar): Hide the
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index ffa1e2a469..55566d7cfb 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -1006,9 +1006,9 @@ setup_widgets (EShellView *shell_view)
/* GtkObject methods. */
static void
-hash_forall_destroy_view (void *name,
- void *value,
- void *data)
+hash_foreach_destroy_view (void *name,
+ void *value,
+ void *data)
{
View *view;
@@ -1017,8 +1017,6 @@ hash_forall_destroy_view (void *name,
gtk_widget_destroy (view->control);
view_destroy (view);
-
- g_free (name);
}
static void
@@ -1049,7 +1047,7 @@ destroy (GtkObject *object)
gtk_signal_disconnect (GTK_OBJECT (socket_widget), destroy_connection_id);
}
- g_hash_table_foreach (priv->uri_to_view, hash_forall_destroy_view, NULL);
+ g_hash_table_foreach (priv->uri_to_view, hash_foreach_destroy_view, NULL);
g_hash_table_destroy (priv->uri_to_view);
bonobo_object_unref (BONOBO_OBJECT (priv->ui_component));
@@ -1694,7 +1692,6 @@ socket_destroy_cb (GtkWidget *socket_widget, gpointer data)
View *view;
const char *uri;
gboolean viewing_closed_uri;
- char *copy_of_uri;
const char *current_uri;
const char *path;
const char *folder_type;
@@ -1704,9 +1701,8 @@ socket_destroy_cb (GtkWidget *socket_widget, gpointer data)
uri = (const char *) gtk_object_get_data (GTK_OBJECT (socket_widget), "e_shell_view_folder_uri");
- if (!g_hash_table_lookup_extended (priv->uri_to_view, uri,
- (gpointer *)&copy_of_uri,
- (gpointer *)&view)) {
+ view = g_hash_table_lookup (priv->uri_to_view, uri);
+ if (view == NULL) {
g_warning ("What?! Destroyed socket for non-existing URI? -- %s", uri);
return;
}
@@ -1715,9 +1711,8 @@ socket_destroy_cb (GtkWidget *socket_widget, gpointer data)
gtk_widget_destroy (view->control);
+ g_hash_table_remove (priv->uri_to_view, view->uri);
view_destroy (view);
- g_hash_table_remove (priv->uri_to_view, uri);
- g_free (copy_of_uri);
path = get_storage_set_path_from_uri (uri);
folder = e_storage_set_get_folder (e_shell_get_storage_set (priv->shell), path);
@@ -1901,6 +1896,7 @@ show_existing_view (EShellView *shell_view,
/* Out with the old. */
gtk_container_remove (GTK_CONTAINER (parent), view->control);
+ g_hash_table_remove (priv->uri_to_view, view->uri);
view_destroy (view);
/* In with the new. */
@@ -1910,11 +1906,7 @@ show_existing_view (EShellView *shell_view,
gtk_container_add (GTK_CONTAINER (parent), view->control);
- /* The old (destroyed) view is already in the hash table,
- * and g_hash_table_insert will re-use its old (strdup'ed)
- * key rather than the one we pass here.
- */
- g_hash_table_insert (priv->uri_to_view, (char *)uri, view);
+ g_hash_table_insert (priv->uri_to_view, view->uri, view);
/* Show. */
gtk_widget_show (view->control);
@@ -1953,7 +1945,7 @@ create_new_view_for_uri (EShellView *shell_view,
g_assert (page_num != -1);
set_current_notebook_page (shell_view, page_num);
- g_hash_table_insert (priv->uri_to_view, g_strdup (uri), view);
+ g_hash_table_insert (priv->uri_to_view, view->uri, view);
return TRUE;
}
@@ -2031,7 +2023,6 @@ e_shell_view_remove_control_for_uri (EShellView *shell_view,
GtkWidget *control;
int page_num;
int destroy_connection_id;
- char *old_key;
g_return_val_if_fail (shell_view != NULL, FALSE);
g_return_val_if_fail (E_IS_SHELL_VIEW (shell_view), FALSE);
@@ -2039,17 +2030,15 @@ e_shell_view_remove_control_for_uri (EShellView *shell_view,
priv = shell_view->priv;
/* Get the control, remove it from our hash of controls */
- if (!g_hash_table_lookup_extended (priv->uri_to_view, uri,
- (gpointer *)&old_key,
- (gpointer *)&view)) {
+ view = g_hash_table_lookup (priv->uri_to_view, uri);
+ if (view == NULL) {
g_message ("Trying to remove view for non-existing URI -- %s", uri);
return FALSE;
}
control = view->control;
+ g_hash_table_remove (priv->uri_to_view, view->uri);
view_destroy (view);
- g_hash_table_remove (priv->uri_to_view, uri);
- g_free (old_key);
/* Get the socket, remove it from our list of sockets */
socket = find_socket (GTK_CONTAINER (control));
'2004-02-18 11:55:59 +0800'>2004-02-181-6/+0 * Remove BROKEN tag; this port now compiles on 5.x.kris2004-02-181-4/+0 * [seems like when I thought I committed this first, I only committedfenner2004-02-082-6/+5 * Use PLIST_FILES (bento-tested, marcus-reviewed).trevor2004-02-0612-6/+6 * Use PLIST_FILES.trevor2004-02-062-1/+1 * Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-045-1/+5 * Update tcl/tk dependency to 8.4.fenner2004-02-023-3/+14 * Upgrade rat to version 4.2.25.fenner2004-02-025-33/+12 * Update to sdr 3.0.fenner2004-02-023-14/+3 * SIZEify.trevor2004-01-303-0/+3 * Use the new ghostscript options.marcus2004-01-211-9/+3 * Add a dummy run-autotools target to pacify the new bsd.port.mk.marcus2004-01-201-0/+3 * Reset maintainer to ports@ due to maintainer's request -- he hasn'tlinimon2004-01-131-1/+1 * - Update to 2.99.1pav2004-01-0912-37/+189 * Add xspeakfree, a Tcl/Tk frontent to Speak Freely.pav2003-12-135-0/+56 * Mark as broken on 5.x due to the usual gcc3.3 bitrot.linimon2003-12-121-2/+8 * - Unbreak by adding dependency on makedepend.pav2003-11-211-0/+2 * Define USE_PERL5_BUILD, not erroneous USE_PERL.trevor2003-11-201-1/+1 * Define USE_PERL to make Perl available for (mostly deprecated)trevor2003-11-201-0/+1 * Add mcl 2.99,bms2003-11-1532-0/+560 * ports with possibly unreachable MAINTAINERsedwin2003-11-021-1/+1 * Move inclusion of bsd.port.pre.mk after definiton of all variables.linimon2003-10-295-24/+28 * Remove blank line to pacify portlint.linimon2003-10-221-1/+0 * Mark as broken on 5.x. Fix plist. Notified maintainer.linimon2003-10-222-2/+7 * Mark as broken on 5.x. The last distfile is from 1997. A google searchlinimon2003-10-221-2/+8 * Mark as broken on 5.x. The distfile is from 1997. While here, updatelinimon2003-10-222-1/+9 * Mark broken on 5.x. The distfile is from 1996 so updates might notlinimon2003-10-222-1/+9 * Make portlint(1) happy by changing strip to ${STRIP_CMD}osa2003-09-243-4/+4 * [PATCH] mbone/wb: enable choose of ghostscript interpreteredwin2003-08-311-1/+15 * Update to 7.6a.naddy2003-06-264-36/+43 * Undo an obsoleted patch to include <sys/soundcard.h> instead ofkris2003-05-101-3/+3 * Use -DAUDIO_BLOCKING. This should hopefully fix sfmike wedging and becomingadamw2003-03-241-1/+1 * Clear moonlight beckons.ade2003-03-0720-10/+10 * Remove RESTRICTED tag for crypto stuff.nork2003-02-232-3/+0 * De-pkg-comment.knu2003-02-214-2/+2 * De-pkg-comment.knu2003-02-214-2/+2 * Don't treat alpha specially with INT_64. INT_64 is not used consistentlyfenner2003-02-011-0/+15 * Make the struct huffentry public so that global variablesfenner2003-01-241-0/+16 * Use std::memset instead of just memsetfenner2003-01-241-0/+73 * Fix signal handler prototype to make newer g++ happyfenner2003-01-242-0/+18 * Build with tcl/tk 8.3fenner2003-01-242-37/+37 * Change of back-up location.orion2003-01-211-3/+3 * Partially fix build on sparc64 (Don't need to prototype inet_ntopkris2003-01-121-0/+13 * fix fetch for mbone/speak-freelyedwin2002-12-126-88/+54 * Fix fetcharved2002-12-111-1/+1 * Made mbone/rat compiling again (double patch-file)edwin2002-11-151-53/+0 * o Rollback PORTCOMMENT modifications while this feature's implementationlioux2002-11-114-4/+2 * Use PORTCOMMENT in the Makefile, and whack the pkg-comment.adamw2002-11-074-2/+4 * Change MAINTAINER to tmutoh@mx10.freecom.ne.jp.nork2002-10-271-1/+1 * Fix build on -current and respect CC and CFLAGSkris2002-10-215-72/+96 * MASTER_SITE moved. Upgrade still to do.fenner2002-10-081-1/+1 * Fix broken rtpmon build.fenner2002-09-303-12/+35 * Fix broken rqm port to work with more modern uclmmbasefenner2002-09-301-0/+18 * Fix build on -current (machine/soundcard.h -> sys/soundcard.h)kris2002-09-082-0/+22 * Update to version 4.2.22.orion2002-08-114-293/+8 * Bump PORTREVISION.jkoshy2002-06-131-0/+1 * Fix a bug that removes a startup problem with rtpmon, namely erroring outjkoshy2002-06-111-0/+10 * machine/soundcard.h -> sys/soundcard.hpetef2002-06-071-0/+5 * Support IPv6.sumikawa2002-03-244-2/+81 * Sync to rat-4.2.20.orion2002-02-259-168/+305 * Fix MASTER_SITES and remove redundant distinfo entrypat2002-02-082-2/+1 * Fix for autoconfpat2002-01-271-2/+2 * Fix for -CURRENT, malloc.h->stdlib.hpat2002-01-021-0/+4 * Set LATEST_LINK to rat30.knu2001-11-071-0/+2 * Sort entries and remove a duplicate "rqm".knu2001-09-211-2/+1 * Replace the ghostscript55 dependencies with ghostscript-gnu.knu2001-09-121-1/+1 * Make nte initialize TCL properly.fenner2001-08-021-0/+16 * Update to vic 2.8ucl-1.1.3fenner2001-08-0230-3415/+149 * New port for multicast AV tool.kiri2001-06-079-0/+113 * New port for RAT(network audio tool) version 3.kiri2001-06-0710-0/+199 * wb compatible open source shared whiteboard programassar2001-05-127-0/+90 * Update to rtptools 1.17fenner2001-04-22