Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Memory Leak Fixes

  • Loading branch information...
commit e17f5f0fb34a025eea6ac0ec8ed456d833d878f2 1 parent e154dd4
@kylebrowning authored
View
1  DIOSComment.m
@@ -94,6 +94,7 @@ + (void)commentIndexWithPage:(NSString *)page
[commentIndexDict setValue:parameteres forKey:@"parameters"];
[commentIndexDict setValue:pageSize forKey:@"pagesize"];
[self commentIndex:commentIndexDict success:success failure:failure];
+ [commentIndexDict release];
}
+ (void)commentIndex:(NSDictionary *)params
View
2  DIOSFile.h
@@ -40,7 +40,7 @@
+ (void) fileGet:(NSDictionary *)params
success:(void (^)(AFHTTPRequestOperation *operation, id responseObject)) success
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error)) failure;
-+ (void) fileSave:(NSDictionary *)params
++ (void)fileSave:(NSDictionary *)file
success:(void (^)(AFHTTPRequestOperation *operation, id responseObject)) success
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error)) failure;
+ (UIImageView *) getImageViewForFileImage:(NSDictionary *) file;
View
1  DIOSFile.m
@@ -63,6 +63,7 @@ + (UIImageView *) getImageViewForFileImage:(NSDictionary *) file; {
NSURL *url = [NSURL URLWithString:[file objectForKey:@"uri_full"]];
UIImageView *remoteImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
[remoteImage setImageWithURL:url];
+ [remoteImage release];
return remoteImage;
}
@end
View
12 DIOSNode.m
@@ -76,8 +76,7 @@ + (void)nodeUpdate:(NSDictionary *)node
+ (void)nodeDelete:(NSDictionary *)node
success:(void (^)(AFHTTPRequestOperation *operation, id responseObject)) success
failure:(void (^)(AFHTTPRequestOperation *operation, NSError *error)) failure {
-
- [[DIOSSession sharedSession] deletePath:[NSString stringWithFormat:@"%@/%@/%@", kDiosEndpoint, kDiosBaseNode, [node objectForKey:@"nid"]]
+ [[DIOSSession sharedSession] deletePath:[NSString stringWithFormat:@"%@/%@/%@", kDiosEndpoint, kDiosBaseNode, [node objectForKey:@"nid"]]
parameters:node
success:success
failure:failure];
@@ -93,6 +92,7 @@ + (void)nodeIndexWithPage:(NSString *)page fields:(NSString *)fields parameters:
[nodeIndexDict setValue:parameteres forKey:@"parameters"];
[nodeIndexDict setValue:pageSize forKey:@"pagesize"];
[self nodeIndex:nodeIndexDict success:success failure:failure];
+ [nodeIndexDict release];
}
+ (void)nodeIndex:(NSDictionary *)params
@@ -111,11 +111,11 @@ + (void)nodeAttachFile:(NSDictionary *)params
}];
AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request];
- [operation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
- NSLog(@"Sent %lld of %lld bytes", totalBytesWritten, totalBytesExpectedToWrite);
- }];
-
+// [operation setUploadProgressBlock:^(NSInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
+// NSLog(@"Sent %qi of %qi bytes", totalBytesWritten, totalBytesExpectedToWrite);
+// }];
[operation setCompletionBlockWithSuccess:success failure:failure];
[operation start];
+ [operation release];
}
@end
View
5 DIOSSession.h
@@ -41,9 +41,12 @@
@interface DIOSSession : AFHTTPClient {
NSDictionary *user;
+ NSMutableDictionary *accessTokens;
}
@property (strong, nonatomic) NSDictionary *user;
+@property (nonatomic, retain) NSMutableDictionary *accessTokens;
+ (DIOSSession *)sharedSession;
-
++ (DIOSSession *)sharedSessionWithURL:(NSString*)url;
+- (void) addHeaderValue:(NSString*)value forKey:(NSString*)key;
@end
View
17 DIOSSession.m
@@ -40,16 +40,26 @@
#import "AFPropertyListRequestOperation.h"
@implementation DIOSSession
-@synthesize user;
+@synthesize user, accessTokens;
+ (DIOSSession *)sharedSession {
static dispatch_once_t once;
static DIOSSession *sharedSession;
- dispatch_once(&once, ^ {
+ dispatch_once(&once, ^ {
sharedSession = [[self alloc] initWithBaseURL:[NSURL URLWithString:kDiosBaseUrl]];
[sharedSession setParameterEncoding:AFJSONParameterEncoding];
});
return sharedSession;
}
++ (DIOSSession *)sharedSessionWithURL:(NSString*)url {
+ static dispatch_once_t once;
+ static DIOSSession *sharedSession;
+ dispatch_once(&once, ^ {
+ sharedSession = [[self alloc] initWithBaseURL:[NSURL URLWithString:url]];
+ [sharedSession setParameterEncoding:AFJSONParameterEncoding];
+ });
+ [sharedSession setBaseURL:[NSURL URLWithString:url]];
+ return sharedSession;
+}
- (id)initWithBaseURL:(NSURL *)url {
self = [super initWithBaseURL:url];
@@ -64,4 +74,7 @@ - (id)initWithBaseURL:(NSURL *)url {
return self;
}
+- (void) addHeaderValue:(NSString*)value forKey:(NSString*)key {
+ [self setDefaultHeader:key value:value];
+}
@end
View
2  DIOSTaxonomy.m
@@ -50,6 +50,7 @@ + (void)getTreeWithVid:(NSString *)vid
[params setValue:parent forKey:@"parent"];
[params setValue:maxDepth forKey:@"max_depth"];
[self getTreeWithParams:params success:success failure:failure];
+ [params release];
}
+ (void)getTreeWithParams:(NSDictionary *)params
success:(void (^)(AFHTTPRequestOperation *operation, id responseObject)) success
@@ -73,6 +74,7 @@ + (void)selectNodesWithTid:(NSString *)tid
[params setValue:pager forKey:@"pager"];
[params setValue:order forKey:@"prder"];
[self selectNodesWithParams:params success:success failure:failure];
+ [params release];
}
+ (void)selectNodesWithParams:(NSDictionary *)params
success:(void (^)(AFHTTPRequestOperation *operation, id responseObject)) success
View
1  DIOSUser.m
@@ -111,6 +111,7 @@ + (void)userIndexWithPage:(NSString *)page
[userIndexDict setValue:parameteres forKey:@"parameters"];
[userIndexDict setValue:pageSize forKey:@"pagesize"];
[self userIndex:userIndexDict success:success failure:failure];
+ [userIndexDict release];
}
+ (void)userIndex:(NSDictionary *)params
Please sign in to comment.
Something went wrong with that request. Please try again.