summaryrefslogtreecommitdiff
path: root/embed/ephy-embed-shell.c
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2017-01-22 22:55:57 -0600
committerMichael Catanzaro <mcatanzaro@gnome.org>2017-01-22 22:55:57 -0600
commita66cc9c7435f8282759b8bb5faeb5cb715c63b23 (patch)
tree4115acc8de21e9fe34214b5fb08527fd150c0b90 /embed/ephy-embed-shell.c
parent2bcb8588532f2a9869ebd265270e3735469917da (diff)
downloadepiphany-a66cc9c7435f8282759b8bb5faeb5cb715c63b23.tar.gz
embed-shell: avoid problems when toggling adblock settings
Diffstat (limited to 'embed/ephy-embed-shell.c')
-rw-r--r--embed/ephy-embed-shell.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index b3c7d29da..8e2cfcc76 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -762,7 +762,8 @@ ephy_embed_shell_retrieve_filter_file_finished (GFile *src,
/* If failed to retrieve, create an empty file if it doesn't exist to unblock extensions */
stream = g_file_create (data->filter_file, G_FILE_CREATE_NONE, NULL, NULL);
- g_object_unref (stream);
+ if (stream)
+ g_object_unref (stream);
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Error retrieving filter %s: %s\n", g_file_get_uri (data->src_file), error->message);
@@ -859,9 +860,14 @@ ephy_embed_shell_remove_old_adblock_filters (EphyEmbedShell *shell,
static void
ephy_embed_shell_update_adblock_filter_files (EphyEmbedShell *shell)
{
+ EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
char **filters;
GList *files = NULL;
+ /* One at a time please! */
+ if (priv->uri_tester_update_cancellable)
+ g_cancellable_cancel (priv->uri_tester_update_cancellable);
+
if (!g_settings_get_boolean (EPHY_SETTINGS_WEB, EPHY_PREFS_WEB_ENABLE_ADBLOCK)) {
ephy_embed_shell_remove_old_adblock_filters (shell, files);
return;