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

Side by Side Diff: lib/filterStorage.js

Issue 29853574: Issue 6855 - Release all references to Subscription object once removed (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Aug. 11, 2018, 3:21 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | lib/subscriptionClasses.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 { 142 {
143 for (let i = 0; i < FilterStorage.subscriptions.length; i++) 143 for (let i = 0; i < FilterStorage.subscriptions.length; i++)
144 { 144 {
145 if (FilterStorage.subscriptions[i].url == subscription.url) 145 if (FilterStorage.subscriptions[i].url == subscription.url)
146 { 146 {
147 removeSubscriptionFilters(subscription); 147 removeSubscriptionFilters(subscription);
148 148
149 FilterStorage.subscriptions.splice(i--, 1); 149 FilterStorage.subscriptions.splice(i--, 1);
150 FilterStorage.knownSubscriptions.delete(subscription.url); 150 FilterStorage.knownSubscriptions.delete(subscription.url);
151 FilterNotifier.triggerListeners("subscription.removed", subscription); 151 FilterNotifier.triggerListeners("subscription.removed", subscription);
152
153 subscription.free();
Manish Jethani 2018/08/11 15:28:17 At this point all the other references to this obj
152 return; 154 return;
153 } 155 }
154 } 156 }
155 }, 157 },
156 158
157 /** 159 /**
158 * Moves a subscription in the list to a new position. 160 * Moves a subscription in the list to a new position.
159 * @param {Subscription} subscription filter subscription to be moved 161 * @param {Subscription} subscription filter subscription to be moved
160 * @param {Subscription} [insertBefore] filter subscription to insert before 162 * @param {Subscription} [insertBefore] filter subscription to insert before
161 * (if omitted the subscription will be put at the end of the list) 163 * (if omitted the subscription will be put at the end of the list)
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 else if (this.wantObj === false && val) 775 else if (this.wantObj === false && val)
774 this.curObj.push(val.replace(/\\\[/g, "[")); 776 this.curObj.push(val.replace(/\\\[/g, "["));
775 } 777 }
776 finally 778 finally
777 { 779 {
778 Filter.knownFilters = origKnownFilters; 780 Filter.knownFilters = origKnownFilters;
779 Subscription.knownSubscriptions = origKnownSubscriptions; 781 Subscription.knownSubscriptions = origKnownSubscriptions;
780 } 782 }
781 } 783 }
782 }; 784 };
OLDNEW
« no previous file with comments | « no previous file | lib/subscriptionClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld