File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ extern NSTimeInterval const PFEventuallyQueueDefaultTimeoutRetryInterval;
67
67
- (void )start NS_REQUIRES_SUPER;
68
68
- (void )resume NS_REQUIRES_SUPER;
69
69
- (void )pause NS_REQUIRES_SUPER;
70
-
70
+ - ( void ) stop NS_REQUIRES_SUPER;
71
71
- (void )removeAllCommands NS_REQUIRES_SUPER;
72
72
73
73
@end
Original file line number Diff line number Diff line change @@ -197,6 +197,10 @@ - (void)pause {
197
197
dispatch_suspend (_processingQueueSource);
198
198
}
199
199
200
+ - (void )stop {
201
+ dispatch_source_cancel (_processingQueueSource);
202
+ }
203
+
200
204
- (void )removeAllCommands {
201
205
dispatch_sync (_synchronizationQueue, ^{
202
206
[_taskCompletionSources removeAllObjects ];
Original file line number Diff line number Diff line change @@ -173,12 +173,15 @@ - (PFEventuallyQueue *)eventuallyQueue {
173
173
[PFPinningEventuallyQueue newDefaultPinningEventuallyQueueWithDataSource: self ]
174
174
:
175
175
commandCache);
176
-
177
176
// We still need to clear out the old command cache even if we're using Pinning in case
178
177
// anything is left over when the user upgraded. Checking number of pending and then
179
178
// clearing should be enough.
180
- if (self.offlineStoreLoaded && commandCache.commandCount > 0 ) {
181
- [commandCache removeAllCommands ];
179
+ if (self.offlineStoreLoaded ) {
180
+ if (commandCache.commandCount > 0 ) {
181
+ [commandCache removeAllCommands ];
182
+ }
183
+ // we won't need it after stop everything...
184
+ [commandCache stop ];
182
185
}
183
186
}
184
187
#endif
@@ -436,7 +439,6 @@ - (BFTask *)preloadDiskObjectsToMemoryAsync {
436
439
#endif
437
440
];
438
441
[[BFTask taskForCompletionOfAllTasks: tasks] waitUntilFinished ]; // Wait synchronously to make sure we are blocking preload queue.
439
- [self eventuallyQueue ];
440
442
441
443
return nil ;
442
444
}];
You can’t perform that action at this time.
0 commit comments