diff options
author | Chris Toshok <toshok@ximian.com> | 2002-11-10 17:49:37 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2002-11-10 17:49:37 +0800 |
commit | 9aa24e5bd2d516b9722db784a16fd3ef838037a1 (patch) | |
tree | cf9bfd4dacba4a19b7c2b0d57d9d79757c7ed55d /addressbook/backend/pas/pas-book.c | |
parent | 28bc0361b9db902a9bcca18cfc5c1b9cc37a7229 (diff) | |
download | gsoc2013-evolution-9aa24e5bd2d516b9722db784a16fd3ef838037a1.tar gsoc2013-evolution-9aa24e5bd2d516b9722db784a16fd3ef838037a1.tar.gz gsoc2013-evolution-9aa24e5bd2d516b9722db784a16fd3ef838037a1.tar.bz2 gsoc2013-evolution-9aa24e5bd2d516b9722db784a16fd3ef838037a1.tar.lz gsoc2013-evolution-9aa24e5bd2d516b9722db784a16fd3ef838037a1.tar.xz 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/pas/pas-book.c')
-rw-r--r-- | addressbook/backend/pas/pas-book.c | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/addressbook/backend/pas/pas-book.c b/addressbook/backend/pas/pas-book.c index f43c73da64..9ca049e350 100644 --- a/addressbook/backend/pas/pas-book.c +++ b/addressbook/backend/pas/pas-book.c @@ -870,35 +870,40 @@ static void pas_book_dispose (GObject *object) { PASBook *book = PAS_BOOK (object); - GList *l; - CORBA_Environment ev; - for (l = book->priv->request_queue; l != NULL; l = l->next) { - pas_book_free_request ((PASRequest *)l->data); - } - g_list_free (book->priv->request_queue); - - /* We should never ever have timeout_id == 0 when we get destroyed, unless there - is some sort of reference counting bug. Still, we do this to try to avoid - horrible crashes in those situations. */ - if (book->priv->timeout_id) { - g_warning ("PASBook destroyed with non-zero timeout_id. This shouldn't happen."); - g_source_remove (book->priv->timeout_id); - book->priv->timeout_id = 0; - } + if (book->priv) { + GList *l; + CORBA_Environment ev; + + for (l = book->priv->request_queue; l != NULL; l = l->next) { + pas_book_free_request ((PASRequest *)l->data); + } + g_list_free (book->priv->request_queue); + + /* We should never ever have timeout_id == 0 when we + get destroyed, unless there is some sort of + reference counting bug. Still, we do this to try + to avoid horrible crashes in those situations. */ + if (book->priv->timeout_id) { + g_warning ("PASBook destroyed with non-zero timeout_id. This shouldn't happen."); + g_source_remove (book->priv->timeout_id); + book->priv->timeout_id = 0; + } - CORBA_exception_init (&ev); - CORBA_Object_release (book->priv->listener, &ev); + CORBA_exception_init (&ev); + CORBA_Object_release (book->priv->listener, &ev); - if (ev._major != CORBA_NO_EXCEPTION) - g_message ("pas_book_construct(): could not release the listener"); + if (ev._major != CORBA_NO_EXCEPTION) + g_message ("pas_book_construct(): could not release the listener"); - CORBA_exception_free (&ev); + CORBA_exception_free (&ev); - g_free (book->priv); - book->priv = NULL; + g_free (book->priv); + book->priv = NULL; + } - G_OBJECT_CLASS (pas_book_parent_class)->dispose (object); + if (G_OBJECT_CLASS (pas_book_parent_class)->dispose) + G_OBJECT_CLASS (pas_book_parent_class)->dispose (object); } static void |