Permalink
Browse files

correct memory management

  • Loading branch information...
1 parent 9a2e2e7 commit afba42de8acc51d04c734d0dce8f34c30ba87736 @eigentone11 eigentone11 committed Jun 8, 2011
Showing with 13 additions and 4 deletions.
  1. +13 −4 OARequestParameter.m
View
@@ -31,12 +31,21 @@ @implementation OARequestParameter
@synthesize name, value;
- (id)initWithName:(NSString *)aName value:(NSString *)aValue {
- [super init];
- self.name = aName;
- self.value = aValue;
- return self;
+ self = [super init];
+ if (self != nil) {
+ name = [aName copy];
+ value = [aValue copy];
+ }
+ return self;
+}
+
+- (void)dealloc {
+ [name release], name = nil;
+ [value release], value = nil;
+ [super dealloc];
}
+
- (NSString *)URLEncodedName {
return self.name;
// return [self.name encodedURLParameterString];

0 comments on commit afba42d

Please sign in to comment.