From 7ece86ff394e037447767408643e108da8f4658f Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Tue, 13 Mar 2012 11:02:48 +0200 Subject: ephy-embed: cancel the pending history queries during finalize https://bugzilla.gnome.org/show_bug.cgi?id=671901 --- embed/ephy-embed.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'embed') diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index 1c7505798..205f2573b 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -72,6 +72,7 @@ struct _EphyEmbedPrivate GtkPaned *paned; WebKitWebView *web_view; EphyHistoryService *history_service; + GCancellable *history_service_cancellable; GtkWidget *inspector_window; GtkWidget *inspector_web_view; GtkWidget *inspector_scrolled_window; @@ -267,7 +268,7 @@ restore_zoom_level (EphyEmbed *embed, /* restore zoom level */ if (ephy_embed_utils_address_has_web_scheme (address)) { ephy_history_service_get_host_for_url (embed->priv->history_service, - address, NULL, + address, embed->priv->history_service_cancellable, (EphyHistoryJobCallback)get_host_for_url_cb, embed); } } @@ -434,6 +435,11 @@ ephy_embed_dispose (GObject *object) priv->progress_update_handler_id = 0; } + if (priv->history_service_cancellable) { + g_cancellable_cancel (priv->history_service_cancellable); + g_clear_object (&priv->history_service_cancellable); + } + G_OBJECT_CLASS (ephy_embed_parent_class)->dispose (object); } @@ -827,6 +833,7 @@ ephy_embed_constructed (GObject *object) ephy_embed_prefs_add_embed (embed); priv->history_service = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service (ephy_embed_shell_get_default ())); + priv->history_service_cancellable = g_cancellable_new (); g_signal_connect (priv->history_service, "cleared", G_CALLBACK (ephy_embed_history_cleared_cb), -- cgit