diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2012-03-14 22:44:34 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2012-06-13 22:32:16 +0800 |
commit | 59c27f399380abedc9fc39ea18238448bf2b9230 (patch) | |
tree | 6880909d6d62d3b2a03902d250c93cb497210323 /src | |
parent | e83e965f4d59773d3f54fdfd85f1c862c45d6111 (diff) | |
download | gsoc2013-epiphany-59c27f399380abedc9fc39ea18238448bf2b9230.tar.gz gsoc2013-epiphany-59c27f399380abedc9fc39ea18238448bf2b9230.tar.zst gsoc2013-epiphany-59c27f399380abedc9fc39ea18238448bf2b9230.zip |
ephy-history-window: cancel history operations during dispose
To avoid surprises if the history-window happens to be destroyed.
https://bugzilla.gnome.org/show_bug.cgi?id=672073
Diffstat (limited to 'src')
-rw-r--r-- | src/ephy-history-window.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c index 7581f3d2f..101b287d5 100644 --- a/src/ephy-history-window.c +++ b/src/ephy-history-window.c @@ -101,6 +101,7 @@ filter_now (EphyHistoryWindow *editor, gboolean hosts, gboolean pages); struct _EphyHistoryWindowPrivate { EphyHistoryService *history_service; + GCancellable *cancellable; GtkWidget *hosts_view; GtkWidget *pages_view; EphyURLsStore *urls_store; @@ -460,13 +461,13 @@ cmd_delete (GtkAction *action, { GList *selected; selected = ephy_urls_view_get_selection (EPHY_URLS_VIEW (editor->priv->pages_view)); - ephy_history_service_delete_urls (editor->priv->history_service, selected, NULL, + ephy_history_service_delete_urls (editor->priv->history_service, selected, editor->priv->cancellable, (EphyHistoryJobCallback)on_browse_history_deleted_cb, editor); } else if (gtk_widget_is_focus (editor->priv->hosts_view)) { EphyHistoryHost *host = get_selected_host (editor); if (host) { ephy_history_service_delete_host (editor->priv->history_service, - host, NULL, + host, editor->priv->cancellable, (EphyHistoryJobCallback)on_host_deleted_cb, editor); ephy_history_host_free (host); @@ -1076,7 +1077,7 @@ filter_now (EphyHistoryWindow *editor, if (hosts) { ephy_history_service_find_hosts (editor->priv->history_service, - from, to, NULL, + from, to, editor->priv->cancellable, (EphyHistoryJobCallback) on_get_hosts_cb, editor); } @@ -1086,7 +1087,7 @@ filter_now (EphyHistoryWindow *editor, ephy_history_service_find_urls (editor->priv->history_service, from, to, 0, host ? host->id : 0, - substrings, NULL, + substrings, editor->priv->cancellable, (EphyHistoryJobCallback)on_find_urls_cb, editor); ephy_history_host_free (host); } @@ -1288,6 +1289,7 @@ ephy_history_window_constructed (GObject *object) "history_paned", 130); + editor->priv->cancellable = g_cancellable_new (); filter_now (editor, TRUE, TRUE); g_signal_connect_after (editor->priv->history_service, @@ -1392,5 +1394,11 @@ ephy_history_window_dispose (GObject *object) editor->priv->hosts_view = NULL; } + if (editor->priv->cancellable) + { + g_cancellable_cancel (editor->priv->cancellable); + g_clear_object (&editor->priv->cancellable); + } + G_OBJECT_CLASS (ephy_history_window_parent_class)->dispose (object); } |