aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-addressbook-model.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-11-09 12:10:06 +0800
committerChris Toshok <toshok@src.gnome.org>2002-11-09 12:10:06 +0800
commit28bc0361b9db902a9bcca18cfc5c1b9cc37a7229 (patch)
treea115a4c945d9d6cc6234437d0d2c12968a7a4602 /addressbook/gui/widgets/e-addressbook-model.c
parent0e0185635f94d23443341fe15dd8fef4951e8db6 (diff)
downloadgsoc2013-evolution-28bc0361b9db902a9bcca18cfc5c1b9cc37a7229.tar
gsoc2013-evolution-28bc0361b9db902a9bcca18cfc5c1b9cc37a7229.tar.gz
gsoc2013-evolution-28bc0361b9db902a9bcca18cfc5c1b9cc37a7229.tar.bz2
gsoc2013-evolution-28bc0361b9db902a9bcca18cfc5c1b9cc37a7229.tar.lz
gsoc2013-evolution-28bc0361b9db902a9bcca18cfc5c1b9cc37a7229.tar.xz
gsoc2013-evolution-28bc0361b9db902a9bcca18cfc5c1b9cc37a7229.tar.zst
gsoc2013-evolution-28bc0361b9db902a9bcca18cfc5c1b9cc37a7229.zip
guard against multiple invocations. (remove_book_view): same.
2002-11-08 Chris Toshok <toshok@ximian.com> * gui/widgets/e-addressbook-model.c (free_data): guard against multiple invocations. (remove_book_view): same. (addressbook_dispose): same. * gui/widgets/e-addressbook-view.c (e_addressbook_view_dispose): same. * gui/widgets/e-minicard-view-widget.c (e_minicard_view_widget_dispose): same. * gui/widgets/e-minicard-view.c (e_minicard_view_dispose): same. * gui/widgets/e-minicard-widget.c (e_minicard_widget_dispose): same. svn path=/trunk/; revision=18685
Diffstat (limited to 'addressbook/gui/widgets/e-addressbook-model.c')
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index e40ca3ce9a..1d5b228bac 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -57,16 +57,18 @@ static guint e_addressbook_model_signals [LAST_SIGNAL] = {0, };
static void
free_data (EAddressbookModel *model)
{
- int i;
+ if (model->data) {
+ int i;
- for ( i = 0; i < model->data_count; i++ ) {
- g_object_unref (model->data[i]);
- }
+ for ( i = 0; i < model->data_count; i++ ) {
+ g_object_unref (model->data[i]);
+ }
- g_free(model->data);
- model->data = NULL;
- model->data_count = 0;
- model->allocated_count = 0;
+ g_free(model->data);
+ model->data = NULL;
+ model->data_count = 0;
+ model->allocated_count = 0;
+ }
}
static void
@@ -99,9 +101,8 @@ remove_book_view(EAddressbookModel *model)
if (model->book_view) {
e_book_view_stop (model->book_view);
g_object_unref (model->book_view);
+ model->book_view = NULL;
}
-
- model->book_view = NULL;
}
static void
@@ -132,7 +133,13 @@ addressbook_dispose(GObject *object)
model->book = NULL;
}
- g_free (model->query);
+ if (model->query) {
+ g_free (model->query);
+ model->query = NULL;
+ }
+
+ if (G_OBJECT_CLASS(parent_class)->dispose)
+ G_OBJECT_CLASS(parent_class)->dispose(object);
}
static void