[evolution-patches] 40896, 43020: selection handling in e-cell-text



This patch fixes the destruction semantics for the GtkInvisible used to
handle selections in ect.  The former weakref approach led to invisibles
sticking around for Edit contexts that had already been destroyed,
leading to all manner of valgrind spewage.

This definitely fixes 40896, and is closely related to (in fact the
valgrindage came from) 43020 so it may get two birds plus dups.

Mike
Index: gal/e-table/e-cell-text.c
===================================================================
RCS file: /cvs/gnome/gal/gal/e-table/e-cell-text.c,v
retrieving revision 1.126
diff -u -p -r1.126 e-cell-text.c
--- gal/e-table/e-cell-text.c	29 Apr 2003 18:27:04 -0000	1.126
+++ gal/e-table/e-cell-text.c	16 May 2003 17:56:07 -0000
@@ -250,14 +250,6 @@ ect_queue_redraw (ECellTextView *text_vi
 		view_col, view_row, view_col, view_row);
 }
 
-static void
-invisible_finalize (gpointer data,
-		    GObject *invisible)
-{
-	CellEdit *edit = data;
-	edit->invisible = NULL;
-}
-
 /*
  * Shuts down the editing process
  */
@@ -277,9 +269,8 @@ ect_stop_editing (ECellTextView *text_vi
 	
 	old_text = edit->old_text;
 	text = edit->text;
-	if (edit->invisible) {
-		g_object_weak_unref (G_OBJECT (edit->invisible), invisible_finalize, edit);
-	}
+	if (edit->invisible)
+		gtk_widget_destroy (edit->invisible);
 	if (edit->tep)
 		g_object_unref (edit->tep);
 	if (edit->primary_selection)
@@ -2215,8 +2206,6 @@ static GtkWidget *e_cell_text_view_get_i
 		g_signal_connect (invisible, "selection_received",
 				  G_CALLBACK (_selection_received),
 				  edit);
-
-		g_object_weak_ref (G_OBJECT (invisible), invisible_finalize, edit);
 	}
 	return edit->invisible;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]