]> git.saurik.com Git - cydia.git/commitdiff
Primary excursion into improving memory management.
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 23 Feb 2011 02:04:33 +0000 (18:04 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 23 Feb 2011 02:21:10 +0000 (18:21 -0800)
MobileCydia.mm

index 675e95b7027668cd844ac1c96dc1d1d69d7678c4..79582982252d23ef88f84b13e7b371ef95affca7 100644 (file)
@@ -4188,9 +4188,9 @@ static NSString *Warning_;
 
 /* @ Loading... Indicator {{{ */
 @interface CYLoadingIndicator : UIView {
 
 /* @ Loading... Indicator {{{ */
 @interface CYLoadingIndicator : UIView {
-    UIActivityIndicatorView *spinner_;
-    UILabel *label_;
-    UIView *container_;
+    _H<UIActivityIndicatorView> spinner_;
+    _H<UILabel> label_;
+    _H<UIView> container_;
 }
 
 @property (readonly, nonatomic) UILabel *label;
 }
 
 @property (readonly, nonatomic) UILabel *label;
@@ -4256,20 +4256,15 @@ static NSString *Warning_;
 /* Emulated Loading Controller {{{ */
 @interface CYEmulatedLoadingController : CYViewController {
     _transient Database *database_;
 /* Emulated Loading Controller {{{ */
 @interface CYEmulatedLoadingController : CYViewController {
     _transient Database *database_;
-    CYLoadingIndicator *indicator_;
-    UITabBar *tabbar_;
-    UINavigationBar *navbar_;
+    _H<CYLoadingIndicator> indicator_;
+    _H<UITabBar> tabbar_;
+    _H<UINavigationBar> navbar_;
 }
 
 @end
 
 @implementation CYEmulatedLoadingController
 
 }
 
 @end
 
 @implementation CYEmulatedLoadingController
 
-- (void) dealloc {
-    [self releaseSubviews];
-    [super dealloc];
-}
-
 - (id) initWithDatabase:(Database *)database {
     if ((self = [super init]) != nil) {
         database_ = database;
 - (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]];
 
     [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_];
 
     [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_];
 
     [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 {
     [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;
     indicator_ = nil;
-
-    [tabbar_ release];
     tabbar_ = nil;
     tabbar_ = nil;
-
-    [navbar_ release];
     navbar_ = nil;
 }
 
     navbar_ = nil;
 }