diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-02-24 09:06:24 -0800 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-03-07 02:41:16 -0800 |
commit | 900095fdf69cc72c5a0d5b1f75c4451a0bc4440e (patch) | |
tree | 03b6c0d67069d8890a4dc74494c1bab62a35abce | |
parent | 123b380c9dc4e9834a7624f50003c5d9e1d76af8 (diff) |
Simplify and correct memory management of SearchController.
-rw-r--r-- | MobileCydia.mm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 249439d..932cb89 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -7618,7 +7618,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @interface SearchController : FilteredPackageListController < UISearchBarDelegate > { - UISearchBar *search_; + _H<UISearchBar> search_; BOOL searchloaded_; } @@ -7631,7 +7631,7 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { @implementation SearchController - (void) dealloc { - [search_ release]; + [search_ setDelegate:nil]; [super dealloc]; } @@ -7660,7 +7660,8 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { - (id) initWithDatabase:(Database *)database { if ((self = [super initWithDatabase:database title:UCLocalize("SEARCH") filter:@selector(isUnfilteredAndSearchedForBy:) with:nil])) { - search_ = [[UISearchBar alloc] init]; + search_ = [[[UISearchBar alloc] init] autorelease]; + [search_ setDelegate:self]; } return self; } @@ -7680,7 +7681,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { textField = MSHookIvar<UITextField *>(search_, "_searchField"); [textField setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin]; - [search_ setDelegate:self]; [textField setEnablesReturnKeyAutomatically:NO]; [[self navigationItem] setTitleView:textField]; } |