Perform start/stop tracking in the main queue

This commit is contained in:
Sergey Abramchuk
2017-07-18 18:06:27 +03:00
parent 3ef3239c08
commit bcfd4ef1d9
+6
View File
@@ -43,11 +43,17 @@
} }
- (void)startTracking { - (void)startTracking {
dispatch_queue_t main = dispatch_get_main_queue();
dispatch_sync(main, ^{
self.reachabilityTracker->reachability_tracker_schedule(); self.reachabilityTracker->reachability_tracker_schedule();
});
} }
- (void)stopTracking { - (void)stopTracking {
dispatch_queue_t main = dispatch_get_main_queue();
dispatch_sync(main, ^{
self.reachabilityTracker->reachability_tracker_cancel(); self.reachabilityTracker->reachability_tracker_cancel();
});
} }
- (void)dealloc { - (void)dealloc {