Permalink
Browse files
fixed a handful of memory leaks
- Loading branch information...
Showing
with
25 additions
and
3 deletions.
-
+15
−2
OAMutableURLRequest.m
-
+5
−0
OARequestParameter.m
-
+5
−1
OAToken.m
|
@@ -53,7 +53,7 @@ - (id)initWithURL:(NSURL *)aUrl |
|
|
if (aToken == nil) {
|
|
|
token = [[OAToken alloc] init];
|
|
|
} else {
|
|
|
- token = aToken;
|
|
|
+ token = [aToken retain];
|
|
|
}
|
|
|
|
|
|
if (aRealm == nil) {
|
|
@@ -127,13 +127,17 @@ - (void)prepare { |
|
|
}
|
|
|
|
|
|
- (void)_generateTimestamp {
|
|
|
- timestamp = [[NSString stringWithFormat:@"%d", time(NULL)] retain];
|
|
|
+ [timestamp release];
|
|
|
+ timestamp = [[NSString alloc]initWithFormat:@"%d", time(NULL)];
|
|
|
}
|
|
|
|
|
|
- (void)_generateNonce {
|
|
|
CFUUIDRef theUUID = CFUUIDCreate(NULL);
|
|
|
CFStringRef string = CFUUIDCreateString(NULL, theUUID);
|
|
|
CFRelease(theUUID);
|
|
|
+ if (nonce) {
|
|
|
+ CFRelease(nonce);
|
|
|
+ }
|
|
|
nonce = (NSString *)string;
|
|
|
}
|
|
|
|
|
@@ -173,4 +177,13 @@ - (NSString *)_signatureBaseString { |
|
|
[normalizedRequestParameters encodedURLString]];
|
|
|
}
|
|
|
|
|
|
+- (void) dealloc
|
|
|
+{
|
|
|
+ [token release];
|
|
|
+ [(NSObject*)signatureProvider release];
|
|
|
+ [timestamp release];
|
|
|
+ CFRelease(nonce);
|
|
|
+ [super dealloc];
|
|
|
+}
|
|
|
+
|
|
|
@end
|
|
@@ -69,4 +69,9 @@ + (id)requestParameter:(NSString *)aName value:(NSString *)aValue |
|
|
return [[[self alloc] initWithName:aName value:aValue] autorelease];
|
|
|
}
|
|
|
|
|
|
+- (void)dealloc{
|
|
|
+ [name release];
|
|
|
+ [value release];
|
|
|
+ [super dealloc];
|
|
|
+}
|
|
|
@end
|
|
@@ -190,7 +190,11 @@ - (NSDictionary *)attributes { |
|
|
|
|
|
- (void)setAttributes:(NSDictionary *)theAttributes {
|
|
|
[attributes release];
|
|
|
- attributes = [[NSMutableDictionary alloc] initWithDictionary:theAttributes];
|
|
|
+ if (theAttributes) {
|
|
|
+ attributes = [[NSMutableDictionary alloc] initWithDictionary:theAttributes];
|
|
|
+ }else {
|
|
|
+ attributes = nil;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- (BOOL)hasAttributes {
|
|
|
0 comments on commit
7aad400