diff options
Diffstat (limited to 'addressbook/backend/ebook/e-book-listener.c')
-rw-r--r-- | addressbook/backend/ebook/e-book-listener.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/addressbook/backend/ebook/e-book-listener.c b/addressbook/backend/ebook/e-book-listener.c index ffcd1fe127..6fb9b737ae 100644 --- a/addressbook/backend/ebook/e-book-listener.c +++ b/addressbook/backend/ebook/e-book-listener.c @@ -690,25 +690,32 @@ static void e_book_listener_dispose (GObject *object) { EBookListener *listener = E_BOOK_LISTENER (object); - GList *l; - /* Remove our response queue handler: In theory, this can never happen since we - always hold a reference to the listener while the timeout is running. */ - if (listener->priv->timeout_id) { - g_source_remove (listener->priv->timeout_id); - } + if (listener->priv) { + GList *l; - /* Clean up anything still sitting in response_queue */ - for (l = listener->priv->response_queue; l != NULL; l = l->next) { - EBookListenerResponse *resp = l->data; + /* Remove our response queue handler: In theory, this + can never happen since we always hold a reference + to the listener while the timeout is running. */ + if (listener->priv->timeout_id) { + g_source_remove (listener->priv->timeout_id); + } - response_free (resp); - } - g_list_free (listener->priv->response_queue); + /* Clean up anything still sitting in response_queue */ + for (l = listener->priv->response_queue; l != NULL; l = l->next) { + EBookListenerResponse *resp = l->data; - g_free (listener->priv); + response_free (resp); + } + g_list_free (listener->priv->response_queue); + + g_free (listener->priv); + + listener->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 |