aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-addressbook-model.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-10-11 16:31:29 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-10-11 16:31:29 +0800
commit81c256ebc1597ccce365adca9861dd96822cf4cd (patch)
treeadfae342966cf08286f9453e97e789f190654dd0 /addressbook/gui/widgets/e-addressbook-model.c
parent4e40ea7c7fe9c469706b23414b1dbe0884e5f267 (diff)
downloadgsoc2013-evolution-81c256ebc1597ccce365adca9861dd96822cf4cd.tar
gsoc2013-evolution-81c256ebc1597ccce365adca9861dd96822cf4cd.tar.gz
gsoc2013-evolution-81c256ebc1597ccce365adca9861dd96822cf4cd.tar.bz2
gsoc2013-evolution-81c256ebc1597ccce365adca9861dd96822cf4cd.tar.lz
gsoc2013-evolution-81c256ebc1597ccce365adca9861dd96822cf4cd.tar.xz
gsoc2013-evolution-81c256ebc1597ccce365adca9861dd96822cf4cd.tar.zst
gsoc2013-evolution-81c256ebc1597ccce365adca9861dd96822cf4cd.zip
Check that view->view != NULL. (save_contact_cb): Check that view->view !=
2001-10-11 Jon Trowbridge <trow@ximian.com> * gui/component/addressbook.c (new_contact_cb): Check that view->view != NULL. (save_contact_cb): Check that view->view != NULL. (search_cb): Check that view->view != NULL. (delete_contact_cb): Check that view->view != NULL. (print_cb): Check that view->view != NULL. (print_preview_cb): Check that view->view != NULL. (stop_loading_cb): Check that view->view != NULL. (cut_contacts_cb): Check that view->view != NULL. (copy_contacts_cb): Check that view->view != NULL. (paste_contacts_cb): Check that view->view != NULL. (select_all_contacts_cb): Check that view->view != NULL. (send_contact_cb): Check that view->view != NULL. (send_contact_to_cb): Check that view->view != NULL. (update_command_state): Check that view->view != NULL. Hold a reference to the AddressbookView for the duration of the function, in case we exit during bonobo-reentrancy. (addressbook_view_ref): Added. (addressbook_view_unref): Added. Simple ref counting for AddressbookView objects. (addressbook_view_clear): Zero out an AddressbookView. This is now separated from the deallocation of the AddressbookView object, so that we don't leave a dangling pointer if we exit during bonobo-reentrancy in update_command_state. (Which often seems to happen if we exit while addressbook operations are going on.) (destroy_callback): Replace previous call to addressbook_view_free with addressbook_view_clear/addressbook_view_unref calls. (addressbook_factory_new_control): Initialize the reference count in the AddressbookView object. * gui/widgets/e-addressbook-view.c (e_addressbook_view_destroy): Carefully zero out our destroyed object. (command_state_change): Hold a reference to ourselves during the signal emission. (get_selected_cards): Ref cards as we add them to the list. (e_addressbook_view_stop): Check for view != NULL. (e_addressbook_view_can_create): Check for view != NULL. (e_addressbook_view_can_print): Check for view != NULL. (e_addressbook_view_can_save_as): Check for view != NULL. (e_addressbook_view_can_send): Check for view != NULL. (e_addressbook_view_can_send_to): Check for view != NULL. (e_addressbook_view_can_delete): Check for view != NULL. (e_addressbook_view_can_cut): Check for view != NULL. (e_addressbook_view_can_copy): Check for view != NULL. (e_addressbook_view_can_paste): Check for view != NULL. (e_addressbook_view_can_select_all): Check for view != NULL. (e_addressbook_view_can_stop): Check for view != NULL. * gui/widgets/e-addressbook-model.c (addressbook_destroy): Be careful about zeroing out our destroyed object. * backend/ebook/e-book-view.c (e_book_view_stop): Added. Stops event processing in the underlying listener. svn path=/trunk/; revision=13578
Diffstat (limited to 'addressbook/gui/widgets/e-addressbook-model.c')
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index fd67d5fd23..a93ae6aa28 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -75,8 +75,9 @@ remove_book_view(EAddressbookModel *model)
model->search_in_progress = FALSE;
- if (model->book_view)
+ if (model->book_view) {
gtk_object_unref(GTK_OBJECT(model->book_view));
+ }
model->book_view = NULL;
}
@@ -87,8 +88,10 @@ addressbook_destroy(GtkObject *object)
EAddressbookModel *model = E_ADDRESSBOOK_MODEL(object);
int i;
- if (model->get_view_idle)
+ if (model->get_view_idle) {
g_source_remove(model->get_view_idle);
+ model->get_view_idle = 0;
+ }
remove_book_view(model);
@@ -100,12 +103,15 @@ addressbook_destroy(GtkObject *object)
model->writable_status_id = 0;
gtk_object_unref(GTK_OBJECT(model->book));
+ model->book = NULL;
}
for ( i = 0; i < model->data_count; i++ ) {
gtk_object_unref(GTK_OBJECT(model->data[i]));
}
+
g_free(model->data);
+ model->data = NULL;
}
static void