[evolution-patches] patch for addressbook bug #41910



can't use model_changed in functions that are called (directly or
indirectly) from e_table_selected_row_foreach, since model_changed
causes the table to free its selection model.  When we return into
etable code we crash or corrupt memory, depending on table size.

Chris
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1391
diff -u -r1.1391 ChangeLog
--- ChangeLog	28 Apr 2003 10:14:11 -0000	1.1391
+++ ChangeLog	28 Apr 2003 19:56:24 -0000
@@ -1,5 +1,17 @@
 2003-04-28  Chris Toshok  <toshok ximian com>
 
+	[ fixes bug #41910 ] 
+	* gui/contact-list-editor/e-contact-list-model.c
+	(e_contact_list_model_remove_row): change from model_changed to
+	row_deleted here.  model_changed causes the table to free its
+	ETableSelection, which is what we iterate over when deleting
+	contacts.
+	(e_contact_list_model_add_destination): no need to be calling
+	model_changed here either.
+
+
+2003-04-28  Chris Toshok  <toshok ximian com>
+
 	[ fixes bug #41843]
 	* tools/evolution-addressbook-export-list-cards.c
 	(e_card_simple_csv_get_name): use e_card_simple_get_ecard_field
Index: gui/contact-list-editor/e-contact-list-model.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/gui/contact-list-editor/e-contact-list-model.c,v
retrieving revision 1.13
diff -u -r1.13 e-contact-list-model.c
--- gui/contact-list-editor/e-contact-list-model.c	23 Mar 2003 09:17:59 -0000	1.13
+++ gui/contact-list-editor/e-contact-list-model.c	28 Apr 2003 19:56:24 -0000
@@ -182,7 +182,7 @@
 	model->data[model->data_count ++] = dest;
 	g_object_ref (dest);
 
-	e_table_model_changed (E_TABLE_MODEL (model));
+	e_table_model_row_inserted (E_TABLE_MODEL (model), model->data_count - 1);
 }
 
 void
@@ -227,7 +227,7 @@
 	memmove (model->data + row, model->data + row + 1, sizeof (EDestination*) * (model->data_count - row - 1));
 	model->data_count --;
 
-	e_table_model_changed (E_TABLE_MODEL (model));
+	e_table_model_row_deleted (E_TABLE_MODEL (model), row);
 }
 
 void


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