aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c4
-rw-r--r--addressbook/gui/widgets/e-minicard-view.c17
-rw-r--r--addressbook/gui/widgets/e-minicard.c12
3 files changed, 20 insertions, 13 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index 367e067687..b2f7332c52 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -37,8 +37,6 @@ addressbook_destroy(GtkObject *object)
if (model->get_view_idle)
g_source_remove(model->get_view_idle);
- if (model->book)
- gtk_object_unref(GTK_OBJECT(model->book));
if (model->book_view && model->create_card_id)
gtk_signal_disconnect(GTK_OBJECT (model->book_view),
model->create_card_id);
@@ -48,6 +46,8 @@ addressbook_destroy(GtkObject *object)
if (model->book_view && model->modify_card_id)
gtk_signal_disconnect(GTK_OBJECT (model->book_view),
model->modify_card_id);
+ if (model->book)
+ gtk_object_unref(GTK_OBJECT(model->book));
if (model->book_view)
gtk_object_unref(GTK_OBJECT(model->book_view));
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
index 13f3d01f26..5f76f15689 100644
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ b/addressbook/gui/widgets/e-minicard-view.c
@@ -126,10 +126,12 @@ modify_card(EBookView *book_view, const GList *cards, EMinicardView *view)
ECard *card = cards->data;
gchar *id = e_card_get_id(card);
GnomeCanvasItem *item = e_reflow_sorted_get_item(E_REFLOW_SORTED(view), id);
- gnome_canvas_item_set(item,
- "card", card,
- NULL);
- e_reflow_sorted_reorder_item(E_REFLOW_SORTED(view), id);
+ if (item && !GTK_OBJECT_DESTROYED(item)) {
+ gnome_canvas_item_set(item,
+ "card", card,
+ NULL);
+ e_reflow_sorted_reorder_item(E_REFLOW_SORTED(view), id);
+ }
}
}
@@ -169,6 +171,7 @@ book_view_loaded (EBook *book, EBookStatus status, EBookView *book_view, gpointe
"card_changed",
GTK_SIGNAL_FUNC(modify_card),
view);
+ g_list_foreach(E_REFLOW(view)->items, (GFunc) gtk_object_unref, NULL);
g_list_foreach(E_REFLOW(view)->items, (GFunc) gtk_object_destroy, NULL);
g_list_free(E_REFLOW(view)->items);
E_REFLOW(view)->items = NULL;
@@ -242,8 +245,6 @@ e_minicard_view_destroy (GtkObject *object)
if (view->get_view_idle)
g_source_remove(view->get_view_idle);
- if (view->book)
- gtk_object_unref(GTK_OBJECT(view->book));
if (view->book_view && view->create_card_id)
gtk_signal_disconnect(GTK_OBJECT (view->book_view),
view->create_card_id);
@@ -253,8 +254,12 @@ e_minicard_view_destroy (GtkObject *object)
if (view->book_view && view->modify_card_id)
gtk_signal_disconnect(GTK_OBJECT (view->book_view),
view->modify_card_id);
+ if (view->book)
+ gtk_object_unref(GTK_OBJECT(view->book));
if (view->book_view)
gtk_object_unref(GTK_OBJECT(view->book_view));
+
+ GTK_OBJECT_CLASS(parent_class)->destroy (object);
}
void
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index 66f7c69da6..7b7b1bcbe5 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -533,11 +533,13 @@ remodel( EMinicard *e_minicard )
GList *list;
char *file_as;
- file_as = e_card_simple_get(e_minicard->simple, E_CARD_SIMPLE_FIELD_FILE_AS);
- gnome_canvas_item_set( e_minicard->header_text,
- "text", file_as ? file_as : "",
- NULL );
- g_free(file_as);
+ if (e_minicard->header_text) {
+ file_as = e_card_simple_get(e_minicard->simple, E_CARD_SIMPLE_FIELD_FILE_AS);
+ gnome_canvas_item_set( e_minicard->header_text,
+ "text", file_as ? file_as : "",
+ NULL );
+ g_free(file_as);
+ }
list = e_minicard->fields;
e_minicard->fields = NULL;