aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--addressbook/ChangeLog18
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c29
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c6
-rw-r--r--addressbook/gui/widgets/e-minicard-view-widget.c17
-rw-r--r--addressbook/gui/widgets/e-minicard-view.c4
-rw-r--r--addressbook/gui/widgets/e-minicard-widget.c4
6 files changed, 59 insertions, 19 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index fb23ec883d..b8c1dce9a5 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,23 @@
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.
+
+2002-11-08 Chris Toshok <toshok@ximian.com>
+
* gui/widgets/e-addressbook-reflow-adapter.c
(addressbook_get_property): oops, missed these casts.
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
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index 0651ddd152..1c74a1b636 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -323,8 +323,10 @@ e_addressbook_view_dispose (GObject *object)
eav->book = NULL;
}
- g_free(eav->query);
- eav->query = NULL;
+ if (eav->query) {
+ g_free(eav->query);
+ eav->query = NULL;
+ }
eav->uic = NULL;
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c
index 3d484560bd..03166005e2 100644
--- a/addressbook/gui/widgets/e-minicard-view-widget.c
+++ b/addressbook/gui/widgets/e-minicard-view-widget.c
@@ -273,13 +273,22 @@ e_minicard_view_widget_dispose (GObject *object)
{
EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(object);
- if (view->book)
+ if (view->book) {
g_object_unref (view->book);
- g_free(view->query);
+ view->book = NULL;
+ }
+ if (view->query) {
+ g_free(view->query);
+ view->query = NULL;
+ }
- g_object_unref (view->adapter);
+ if (view->adapter) {
+ g_object_unref (view->adapter);
+ view->adapter = NULL;
+ }
- G_OBJECT_CLASS(parent_class)->dispose (object);
+ if (G_OBJECT_CLASS(parent_class)->dispose)
+ G_OBJECT_CLASS(parent_class)->dispose (object);
}
static void
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
index 661bf2753d..e4c8db0bd1 100644
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ b/addressbook/gui/widgets/e-minicard-view.c
@@ -271,6 +271,7 @@ e_minicard_view_dispose (GObject *object)
if (view->canvas_drag_data_get_id) {
g_signal_handler_disconnect (GNOME_CANVAS_ITEM (view)->canvas,
view->canvas_drag_data_get_id);
+ view->canvas_drag_data_get_id = 0;
}
if (view->adapter) {
@@ -289,7 +290,8 @@ e_minicard_view_dispose (GObject *object)
view->writable_status_id = 0;
view->adapter = NULL;
- G_OBJECT_CLASS(parent_class)->dispose (object);
+ if (G_OBJECT_CLASS(parent_class)->dispose)
+ G_OBJECT_CLASS(parent_class)->dispose (object);
}
static guint
diff --git a/addressbook/gui/widgets/e-minicard-widget.c b/addressbook/gui/widgets/e-minicard-widget.c
index 75ccfccc98..5c8483ac88 100644
--- a/addressbook/gui/widgets/e-minicard-widget.c
+++ b/addressbook/gui/widgets/e-minicard-widget.c
@@ -181,8 +181,10 @@ e_minicard_widget_dispose (GObject *object)
{
EMinicardWidget *emw = E_MINICARD_WIDGET(object);
- if (emw->card)
+ if (emw->card) {
g_object_unref (emw->card);
+ emw->card = NULL;
+ }
if (G_OBJECT_CLASS(parent_class)->dispose)
G_OBJECT_CLASS(parent_class)->dispose(object);