File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ extern NSTimeInterval const PFEventuallyQueueDefaultTimeoutRetryInterval;
6767- (void )start NS_REQUIRES_SUPER;
6868- (void )resume NS_REQUIRES_SUPER;
6969- (void )pause NS_REQUIRES_SUPER;
70- - (void )stop NS_REQUIRES_SUPER;
70+ - (void )terminate NS_REQUIRES_SUPER;
7171- (void )removeAllCommands NS_REQUIRES_SUPER;
7272
7373@end
Original file line number Diff line number Diff line change @@ -80,10 +80,6 @@ - (instancetype)initWithDataSource:(id<PFCommandRunnerProvider>)dataSource
8080 return self;
8181}
8282
83- - (void )dealloc {
84- [self _stopMonitoringNetworkReachability ];
85- }
86-
8783// /--------------------------------------
8884#pragma mark - Enqueueing Commands
8985// /--------------------------------------
@@ -197,7 +193,8 @@ - (void)pause {
197193 dispatch_suspend (_processingQueueSource);
198194}
199195
200- - (void )stop {
196+ - (void )terminate {
197+ [self _stopMonitoringNetworkReachability ];
201198 dispatch_source_cancel (_processingQueueSource);
202199}
203200
@@ -383,7 +380,6 @@ - (void)_stopMonitoringNetworkReachability {
383380 [[PFReachability sharedParseReachability ] removeListener: self ];
384381
385382 self.monitorsReachability = NO ;
386- self.connected = YES ;
387383#endif
388384}
389385
@@ -393,9 +389,11 @@ - (void)_stopMonitoringNetworkReachability {
393389
394390/* * Manually sets the network connection status. */
395391- (void )setConnected : (BOOL )connected {
392+ @weakify (self);
396393 BFTaskCompletionSource *barrier = [BFTaskCompletionSource taskCompletionSource ];
397394 dispatch_async (_processingQueue, ^{
398395 dispatch_sync (_synchronizationQueue, ^{
396+ @strongify (self);
399397 if (self.connected != connected) {
400398 _connected = connected;
401399 if (connected) {
Original file line number Diff line number Diff line change @@ -130,7 +130,9 @@ - (void)addListener:(id<PFReachabilityListener>)listener {
130130}
131131
132132- (void )removeListener : (id <PFReachabilityListener>)listener {
133+ @weakify (listener);
133134 dispatch_barrier_sync (_synchronizationQueue, ^{
135+ @strongify (listener);
134136 [_listenersArray filterUsingPredicate: [NSPredicate predicateWithBlock: ^BOOL (id evaluatedObject, NSDictionary *bindings) {
135137 id weakObject = [evaluatedObject weakObject ];
136138 return (weakObject == nil || weakObject == listener);
Original file line number Diff line number Diff line change @@ -181,8 +181,8 @@ - (PFEventuallyQueue *)eventuallyQueue {
181181 if (commandCache.commandCount > 0 ) {
182182 [commandCache removeAllCommands ];
183183 }
184- // we won't need it after stop everything ...
185- [commandCache stop ];
184+ // we won't need it after, terminate ...
185+ [commandCache terminate ];
186186 }
187187 }
188188#endif
You can’t perform that action at this time.
0 commit comments