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

Side by Side Diff: lib/synchronizer.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
« lib/filterStorage.js ('K') | « lib/subscriptionClasses.js ('k') | no next file » | 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 { 197 {
198 let oldSubscription = Subscription.fromURL(downloadable.url); 198 let oldSubscription = Subscription.fromURL(downloadable.url);
199 subscription.title = oldSubscription.title; 199 subscription.title = oldSubscription.title;
200 subscription.disabled = oldSubscription.disabled; 200 subscription.disabled = oldSubscription.disabled;
201 subscription.lastCheck = oldSubscription.lastCheck; 201 subscription.lastCheck = oldSubscription.lastCheck;
202 202
203 let listed = FilterStorage.knownSubscriptions.has(oldSubscription.url); 203 let listed = FilterStorage.knownSubscriptions.has(oldSubscription.url);
204 if (listed) 204 if (listed)
205 FilterStorage.removeSubscription(oldSubscription); 205 FilterStorage.removeSubscription(oldSubscription);
206 206
207 Subscription.knownSubscriptions.delete(oldSubscription.url); 207 oldSubscription.free();
208 208
209 if (listed) 209 if (listed)
210 FilterStorage.addSubscription(subscription); 210 FilterStorage.addSubscription(subscription);
211 } 211 }
212 212
213 // The download actually succeeded 213 // The download actually succeeded
214 subscription.lastSuccess = subscription.lastDownload = Math.round( 214 subscription.lastSuccess = subscription.lastDownload = Math.round(
215 Date.now() / MILLIS_IN_SECOND 215 Date.now() / MILLIS_IN_SECOND
216 ); 216 );
217 subscription.downloadStatus = "synchronize_ok"; 217 subscription.downloadStatus = "synchronize_ok";
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 subscription.filters.map(f => f.text).join("\n"); 348 subscription.filters.map(f => f.text).join("\n");
349 redirectCallback("data:text/plain," + encodeURIComponent(data)); 349 redirectCallback("data:text/plain," + encodeURIComponent(data));
350 } 350 }
351 }, false); 351 }, false);
352 request.send(null); 352 request.send(null);
353 } 353 }
354 } 354 }
355 } 355 }
356 }; 356 };
357 Synchronizer.init(); 357 Synchronizer.init();
OLDNEW
« lib/filterStorage.js ('K') | « lib/subscriptionClasses.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld