From 2b5ceba288a3a3de4bceb6767953972b30f97f46 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 6 Mar 2017 21:39:14 -0800 Subject: [PATCH] CyteKit: {retain,release}NetworkActivityIndicator. --- CyteKit/Application.h | 3 +++ CyteKit/Application.mm | 21 ++++++++++++++++++++- MobileCydia.mm | 20 -------------------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/CyteKit/Application.h b/CyteKit/Application.h index d95ad1ca..84355c1a 100644 --- a/CyteKit/Application.h +++ b/CyteKit/Application.h @@ -28,6 +28,9 @@ - (void) applicationDidFinishLaunching:(id)unused; +- (void) retainNetworkActivityIndicator; +- (void) releaseNetworkActivityIndicator; + @end #endif//CyteKit_Application_H diff --git a/CyteKit/Application.mm b/CyteKit/Application.mm index 77b1260c..025cbd79 100644 --- a/CyteKit/Application.mm +++ b/CyteKit/Application.mm @@ -30,7 +30,8 @@ #include "iPhonePrivate.h" #include -@implementation CyteApplication : UIApplication { +@implementation CyteApplication { + unsigned activity_; } - (void) _sendMemoryWarningNotification { @@ -66,4 +67,22 @@ ] autorelease]]; } +- (void) retainNetworkActivityIndicator { + if (activity_++ == 0) + [self setNetworkActivityIndicatorVisible:YES]; + +#if TraceLogging + NSLog(@"retainNetworkActivityIndicator->%d", activity_); +#endif +} + +- (void) releaseNetworkActivityIndicator { + if (--activity_ == 0) + [self setNetworkActivityIndicatorVisible:NO]; + +#if TraceLogging + NSLog(@"releaseNetworkActivityIndicator->%d", activity_); +#endif +} + @end diff --git a/MobileCydia.mm b/MobileCydia.mm index dce9dec8..e6881038 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -8350,7 +8350,6 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi _H starturl_; unsigned locked_; - unsigned activity_; _H stash_; @@ -8771,25 +8770,6 @@ _end [self unlockSuspend]; } -- (void) retainNetworkActivityIndicator { - if (activity_++ == 0) - [self setNetworkActivityIndicatorVisible:YES]; - -#if TraceLogging - NSLog(@"retainNetworkActivityIndicator->%d", activity_); -#endif -} - -- (void) releaseNetworkActivityIndicator { - if (--activity_ == 0) - [self setNetworkActivityIndicatorVisible:NO]; - -#if TraceLogging - NSLog(@"releaseNetworkActivityIndicator->%d", activity_); -#endif - -} - - (void) cancelAndClear:(bool)clear { @synchronized (self) { if (clear) { -- 2.45.2