Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

Commit

Permalink
Stop creating multiple region helpers
Browse files Browse the repository at this point in the history
Should fix #463
  • Loading branch information
aaronbrethorst committed Nov 29, 2015
1 parent 3fa1b9e commit 2fdf6d9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions OBAApplicationDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ - (id)init {
self = [super init];

if (self) {
self.active = NO;
_active = NO;
_regionHelper = [[OBARegionHelper alloc] init];

@weakify(self);
self.regionObserver = [[NSNotificationCenter defaultCenter] addObserverForName:kOBAApplicationSettingsRegionRefreshNotification
object:nil
queue:[NSOperationQueue mainQueue]
usingBlock:^(NSNotification *note) {
@strongify(self);
self.regionHelper = [[OBARegionHelper alloc] init];
[self writeSetRegionAutomatically:YES];
[self.regionHelper updateNearestRegion];
}];
Expand Down Expand Up @@ -130,8 +130,6 @@ - (void)_constructUI {
self.window.rootViewController = self.tabBarController;

if ([[OBAApplication sharedApplication].modelDao.readCustomApiUrl isEqualToString:@""]) {
self.regionHelper = [[OBARegionHelper alloc] init];

if ([OBAApplication sharedApplication].modelDao.readSetRegionAutomatically && [OBAApplication sharedApplication].locationManager.locationServicesEnabled) {
[self.regionHelper updateNearestRegion];
}
Expand Down

0 comments on commit 2fdf6d9

Please sign in to comment.