From a4a27fd05f5e4845b16186cabe9d9a2f21bdb1e6 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 22 Feb 2011 18:04:33 -0800 Subject: Primary excursion into improving memory management. --- MobileCydia.mm | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 675e95b..7958298 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4188,9 +4188,9 @@ static NSString *Warning_; /* @ Loading... Indicator {{{ */ @interface CYLoadingIndicator : UIView { - UIActivityIndicatorView *spinner_; - UILabel *label_; - UIView *container_; + _H spinner_; + _H label_; + _H container_; } @property (readonly, nonatomic) UILabel *label; @@ -4256,20 +4256,15 @@ static NSString *Warning_; /* Emulated Loading Controller {{{ */ @interface CYEmulatedLoadingController : CYViewController { _transient Database *database_; - CYLoadingIndicator *indicator_; - UITabBar *tabbar_; - UINavigationBar *navbar_; + _H indicator_; + _H tabbar_; + _H navbar_; } @end @implementation CYEmulatedLoadingController -- (void) dealloc { - [self releaseSubviews]; - [super dealloc]; -} - - (id) initWithDatabase:(Database *)database { if ((self = [super init]) != nil) { database_ = database; @@ -4280,29 +4275,24 @@ static NSString *Warning_; [self setView:[[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease]]; [[self view] setBackgroundColor:[UIColor pinStripeColor]]; - indicator_ = [[CYLoadingIndicator alloc] initWithFrame:[[self view] bounds]]; + indicator_ = [[[CYLoadingIndicator alloc] initWithFrame:[[self view] bounds]] autorelease]; [indicator_ setAutoresizingMask:UIViewAutoresizingFlexibleBoth]; [[self view] addSubview:indicator_]; - tabbar_ = [[UITabBar alloc] initWithFrame:CGRectMake(0, 0, 0, 49.0f)]; + tabbar_ = [[[UITabBar alloc] initWithFrame:CGRectMake(0, 0, 0, 49.0f)] autorelease]; [tabbar_ setFrame:CGRectMake(0.0f, [[self view] bounds].size.height - [tabbar_ bounds].size.height, [[self view] bounds].size.width, [tabbar_ bounds].size.height)]; [tabbar_ setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleWidth]; [[self view] addSubview:tabbar_]; - navbar_ = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 0, 44.0f)]; + navbar_ = [[[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, 0, 44.0f)] autorelease]; [navbar_ setFrame:CGRectMake(0.0f, 0.0f, [[self view] bounds].size.width, [navbar_ bounds].size.height)]; [navbar_ setAutoresizingMask:UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleWidth]; [[self view] addSubview:navbar_]; } - (void) releaseSubviews { - [indicator_ release]; indicator_ = nil; - - [tabbar_ release]; tabbar_ = nil; - - [navbar_ release]; navbar_ = nil; } -- cgit v1.2.3