From 2ef6faadc0910c127a209d38c53e04c401899ee6 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 20 Jan 2012 00:04:40 -0800 Subject: Factor locked_ variable *crementing to separate methods. --- MobileCydia.mm | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index ba7b9ab..f789b46 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -9340,6 +9340,14 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi @implementation Cydia +- (void) lockSuspend { + ++locked_; +} + +- (void) unlockSuspend { + --locked_; +} + - (void) beginUpdate { [tabbar_ beginUpdate]; } @@ -9709,9 +9717,9 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi - (void) confirmWithNavigationController:(UINavigationController *)navigation { Queuing_ = false; - ++locked_; + [self lockSuspend]; [self detachNewProgressSelector:@selector(perform_) toTarget:self forController:navigation title:@"RUNNING"]; - --locked_; + [self unlockSuspend]; } - (void) showSettings { @@ -9876,12 +9884,12 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi [hud showInView:[target view]]; - ++locked_; + [self lockSuspend]; return hud; } - (void) removeProgressHUD:(UIProgressHUD *)hud { - --locked_; + [self unlockSuspend]; [hud hide]; [hud removeFromSuperview]; [window_ setUserInteractionEnabled:YES]; @@ -10067,7 +10075,7 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi } - (void) addStashController { - ++locked_; + [self lockSuspend]; stash_ = [[[StashController alloc] init] autorelease]; [window_ addSubview:[stash_ view]]; } @@ -10075,7 +10083,7 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi - (void) removeStashController { [[stash_ view] removeFromSuperview]; stash_ = nil; - --locked_; + [self unlockSuspend]; } - (void) stash { -- cgit v1.2.3