Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/filterStorage.js

Issue 29860589: Issue 6829 - Free filters when subscriptions are empty (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Aug. 21, 2018, 9:44 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterStorage.js
===================================================================
--- a/lib/filterStorage.js
+++ b/lib/filterStorage.js
@@ -673,17 +673,21 @@
* @param {Subscription} subscription filter subscription to be removed
*/
function removeSubscriptionFilters(subscription)
{
if (!FilterStorage.knownSubscriptions.has(subscription.url))
return;
for (let filter of subscription.filters)
+ {
filter.subscriptions.delete(subscription);
+ if (filter.subscriptions.size == 0)
Manish Jethani 2018/08/25 15:03:38 removeSubscriptionFilters is also called from upda
jsonesen 2018/08/25 15:18:46 The deletion should I ly occur if there are no sub
jsonesen 2018/08/25 15:32:08 Oh shoot nevermind, since it removes first then ad
Manish Jethani 2018/08/26 15:56:19 Yes, exactly. If a filter is also in a different s
+ Filter.knownFilters.delete(filter.text);
Jon Sonesen 2018/08/21 21:50:41 I found that there is a pretty good reduction in t
+ }
}
/**
* Listener returned by FilterStorage.importData(), parses filter data.
* @constructor
*/
function INIParser()
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld