summaryrefslogtreecommitdiff
path: root/UICaboodle
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2010-11-16 14:10:14 -0800
committerJay Freeman (saurik) <saurik@saurik.com>2010-11-17 10:03:08 -0800
commit3931b718c26a642d829d15aca05a7e775177ee02 (patch)
tree218eda9e62132f7b593195f4e2dac668354409eb /UICaboodle
parent68046ccc10980be3806386e1d0eaf85867bdea60 (diff)
Carefully audited all usages of alloc*/retain/release/autorelease/*Create*, updating _transitive marks on fields.
Diffstat (limited to 'UICaboodle')
-rw-r--r--UICaboodle/BrowserView.h6
-rw-r--r--UICaboodle/BrowserView.mm47
-rw-r--r--UICaboodle/RVBook.h2
3 files changed, 41 insertions, 14 deletions
diff --git a/UICaboodle/BrowserView.h b/UICaboodle/BrowserView.h
index 2f0e4eb..e2da3c0 100644
--- a/UICaboodle/BrowserView.h
+++ b/UICaboodle/BrowserView.h
@@ -58,8 +58,8 @@
HookProtocol,
UIWebViewDelegate
> {
- CYWebView *webview_;
- UIScrollView *scroller_;
+ _transient CYWebView *webview_;
+ _transient UIScrollView *scroller_;
UIProgressIndicator *indicator_;
IndirectDelegate *indirect_;
@@ -68,7 +68,7 @@
bool error_;
NSURLRequest *request_;
- NSNumber *sensitive_;
+ _transient NSNumber *sensitive_;
NSString *title_;
NSMutableSet *loading_;
diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm
index 769aaed..c7af5b3 100644
--- a/UICaboodle/BrowserView.mm
+++ b/UICaboodle/BrowserView.mm
@@ -421,6 +421,9 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
if (challenge_ != nil)
[challenge_ release];
+ if (request_ != nil)
+ [request_ release];
+
//NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
if (custom_ != nil)
@@ -433,11 +436,11 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
if (closer_ != nil)
[closer_ release];
- if (sensitive_ != nil)
- [sensitive_ release];
if (title_ != nil)
[title_ release];
+ [loading_ release];
+
[reloaditem_ release];
[loadingitem_ release];
@@ -493,15 +496,24 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
- (void) setButtonImage:(NSString *)button withStyle:(NSString *)style toFunction:(id)function {
if (custom_ != nil)
[custom_ autorelease];
- custom_ = button == nil ? nil : [[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:button]]] retain];
+ if (button == nil)
+ custom_ = nil;
+ else
+ custom_ = [[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:button]]] retain];
if (style_ != nil)
[style_ autorelease];
- style_ = style == nil ? nil : [style retain];
+ if (style == nil)
+ style_ = nil;
+ else
+ style_ = [style retain];
if (function_ != nil)
[function_ autorelease];
- function_ = function == nil ? nil : [function retain];
+ if (function == nil)
+ function_ = nil;
+ else
+ function_ = [function retain];
[self applyRightButton];
}
@@ -509,15 +521,24 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
- (void) setButtonTitle:(NSString *)button withStyle:(NSString *)style toFunction:(id)function {
if (custom_ != nil)
[custom_ autorelease];
- custom_ = button == nil ? nil : [button retain];
+ if (button == nil)
+ custom_ = nil;
+ else
+ custom_ = [button retain];
if (style_ != nil)
[style_ autorelease];
- style_ = style == nil ? nil : [style retain];
+ if (style == nil)
+ style_ = nil;
+ else
+ style_ = [style retain];
if (function_ != nil)
[function_ autorelease];
- function_ = function == nil ? nil : [function retain];
+ if (function == nil)
+ function_ = nil;
+ else
+ function_ = [function retain];
[self applyRightButton];
}
@@ -525,7 +546,10 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
- (void) setPopupHook:(id)function {
if (closer_ != nil)
[closer_ autorelease];
- closer_ = function == nil ? nil : [function retain];
+ if (function == nil)
+ closer_ = nil;
+ else
+ closer_ = [function retain];
}
- (void) setViewportWidth:(float)width {
@@ -698,7 +722,10 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
if ([frame parentFrame] != nil)
return;
+ if (title_ != nil)
+ [title_ autorelease];
title_ = [title retain];
+
[[self navigationItem] setTitle:title_];
}
@@ -837,7 +864,7 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
- (void) applyRightButton {
if ([self isLoading]) {
[[self navigationItem] setRightBarButtonItem:loadingitem_ animated:YES];
- // XXX: why do we do this again here?
+ // XXX: why do we do this again here? (if we don't, just remove indicator_)
[[loadingitem_ view] addSubview:indicator_];
[self applyLoadingTitle];
} else if (custom_ != nil) {
diff --git a/UICaboodle/RVBook.h b/UICaboodle/RVBook.h
index 8994cbf..1d06b0b 100644
--- a/UICaboodle/RVBook.h
+++ b/UICaboodle/RVBook.h
@@ -7,7 +7,7 @@
@end
@interface UCNavigationController : UINavigationController {
- id<HookProtocol> hook_;
+ _transient id<HookProtocol> hook_;
}
- (void) setHook:(id<HookProtocol>)hook;
@end