aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook/e-book.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-11-10 17:49:37 +0800
committerChris Toshok <toshok@src.gnome.org>2002-11-10 17:49:37 +0800
commit9aa24e5bd2d516b9722db784a16fd3ef838037a1 (patch)
treecf9bfd4dacba4a19b7c2b0d57d9d79757c7ed55d /addressbook/backend/ebook/e-book.c
parent28bc0361b9db902a9bcca18cfc5c1b9cc37a7229 (diff)
downloadgsoc2013-evolution-9aa24e5bd2d516b9722db784a16fd3ef838037a1.tar.gz
gsoc2013-evolution-9aa24e5bd2d516b9722db784a16fd3ef838037a1.tar.zst
gsoc2013-evolution-9aa24e5bd2d516b9722db784a16fd3ef838037a1.zip
guard against multiple invocations.
2002-11-10 Chris Toshok <toshok@ximian.com> * backend/pas/pas-backend-card-sexp.c (pas_backend_card_sexp_dispose): guard against multiple invocations. * backend/pas/pas-card-cursor.c (pas_card_cursor_dispose): same. * backend/pas/pas-book.c (pas_book_dispose): same. * backend/pas/pas-book-view.c (pas_book_view_dispose): same. * backend/pas/pas-book-factory.c (pas_book_factory_dispose): same. * backend/pas/pas-backend-summary.c (pas_backend_summary_dispose): same. * backend/pas/pas-backend-ldap.c (pas_backend_ldap_dispose): same. * backend/pas/pas-backend-file.c (pas_backend_file_dispose): same. * backend/ebook/e-book-listener.c (e_book_listener_dispose): guard against multiple invocations. * backend/ebook/e-card.c (e_card_dispose): same. * backend/ebook/e-card-simple.c (e_card_simple_dispose): same. * backend/ebook/e-card-cursor.c (e_card_cursor_dispose): same. * backend/ebook/e-book.c (e_book_dispose): same. * backend/ebook/e-book-view-listener.c (e_book_view_listener_dispose): same. svn path=/trunk/; revision=18687
Diffstat (limited to 'addressbook/backend/ebook/e-book.c')
-rw-r--r--addressbook/backend/ebook/e-book.c47
1 files changed, 27 insertions, 20 deletions
diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c
index 40938b1e8f..e236bc04ea 100644
--- a/addressbook/backend/ebook/e-book.c
+++ b/addressbook/backend/ebook/e-book.c
@@ -1477,35 +1477,42 @@ static void
e_book_dispose (GObject *object)
{
EBook *book = E_BOOK (object);
- CORBA_Environment ev;
- GList *l;
- if (book->priv->load_state == URILoaded)
- e_book_unload_uri (book);
+ if (book->priv) {
+ CORBA_Environment ev;
+ GList *l;
- CORBA_exception_init (&ev);
+ if (book->priv->load_state == URILoaded)
+ e_book_unload_uri (book);
- for (l = book->priv->book_factories; l; l = l->next) {
- CORBA_Object_release ((CORBA_Object)l->data, &ev);
- if (ev._major != CORBA_NO_EXCEPTION) {
- g_warning ("EBook: Exception while releasing BookFactory\n");
+ CORBA_exception_init (&ev);
+
+ for (l = book->priv->book_factories; l; l = l->next) {
+ CORBA_Object_release ((CORBA_Object)l->data, &ev);
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning ("EBook: Exception while releasing BookFactory\n");
- CORBA_exception_free (&ev);
- CORBA_exception_init (&ev);
+ CORBA_exception_free (&ev);
+ CORBA_exception_init (&ev);
+ }
}
- }
- if (book->priv->comp_listener) {
- g_signal_handler_disconnect (book->priv->comp_listener, book->priv->died_signal);
- g_object_unref (book->priv->comp_listener);
- book->priv->comp_listener = NULL;
- }
+ CORBA_exception_free (&ev);
- g_free (book->priv->uri);
+ if (book->priv->comp_listener) {
+ g_signal_handler_disconnect (book->priv->comp_listener, book->priv->died_signal);
+ g_object_unref (book->priv->comp_listener);
+ book->priv->comp_listener = NULL;
+ }
+
+ g_free (book->priv->uri);
- g_free (book->priv);
+ g_free (book->priv);
+ book->priv = NULL;
+ }
- G_OBJECT_CLASS (parent_class)->dispose (object);
+ if (G_OBJECT_CLASS (parent_class)->dispose)
+ G_OBJECT_CLASS (parent_class)->dispose (object);
}
static void