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;
67
67
- (void )start NS_REQUIRES_SUPER;
68
68
- (void )resume NS_REQUIRES_SUPER;
69
69
- (void )pause NS_REQUIRES_SUPER;
70
- - (void )stop NS_REQUIRES_SUPER;
70
+ - (void )terminate 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 @@ -80,10 +80,6 @@ - (instancetype)initWithDataSource:(id<PFCommandRunnerProvider>)dataSource
80
80
return self;
81
81
}
82
82
83
- - (void )dealloc {
84
- [self _stopMonitoringNetworkReachability ];
85
- }
86
-
87
83
// /--------------------------------------
88
84
#pragma mark - Enqueueing Commands
89
85
// /--------------------------------------
@@ -197,7 +193,8 @@ - (void)pause {
197
193
dispatch_suspend (_processingQueueSource);
198
194
}
199
195
200
- - (void )stop {
196
+ - (void )terminate {
197
+ [self _stopMonitoringNetworkReachability ];
201
198
dispatch_source_cancel (_processingQueueSource);
202
199
}
203
200
@@ -383,7 +380,6 @@ - (void)_stopMonitoringNetworkReachability {
383
380
[[PFReachability sharedParseReachability ] removeListener: self ];
384
381
385
382
self.monitorsReachability = NO ;
386
- self.connected = YES ;
387
383
#endif
388
384
}
389
385
@@ -393,9 +389,11 @@ - (void)_stopMonitoringNetworkReachability {
393
389
394
390
/* * Manually sets the network connection status. */
395
391
- (void )setConnected : (BOOL )connected {
392
+ @weakify (self);
396
393
BFTaskCompletionSource *barrier = [BFTaskCompletionSource taskCompletionSource ];
397
394
dispatch_async (_processingQueue, ^{
398
395
dispatch_sync (_synchronizationQueue, ^{
396
+ @strongify (self);
399
397
if (self.connected != connected) {
400
398
_connected = connected;
401
399
if (connected) {
Original file line number Diff line number Diff line change @@ -130,7 +130,9 @@ - (void)addListener:(id<PFReachabilityListener>)listener {
130
130
}
131
131
132
132
- (void )removeListener : (id <PFReachabilityListener>)listener {
133
+ @weakify (listener);
133
134
dispatch_barrier_sync (_synchronizationQueue, ^{
135
+ @strongify (listener);
134
136
[_listenersArray filterUsingPredicate: [NSPredicate predicateWithBlock: ^BOOL (id evaluatedObject, NSDictionary *bindings) {
135
137
id weakObject = [evaluatedObject weakObject ];
136
138
return (weakObject == nil || weakObject == listener);
Original file line number Diff line number Diff line change @@ -181,8 +181,8 @@ - (PFEventuallyQueue *)eventuallyQueue {
181
181
if (commandCache.commandCount > 0 ) {
182
182
[commandCache removeAllCommands ];
183
183
}
184
- // we won't need it after stop everything ...
185
- [commandCache stop ];
184
+ // we won't need it after, terminate ...
185
+ [commandCache terminate ];
186
186
}
187
187
}
188
188
#endif
You can’t perform that action at this time.
0 commit comments