Browse Source

Merge pull request #62 from zmeyc/pr_enable_arc

Enable ARC in iOS project
Denis Muratshin 10 years ago
parent
commit
bbed079a33

+ 2 - 0
oxygine/SDL/ios/oxygine/oxygine_ios.xcodeproj/project.pbxproj

@@ -1180,6 +1180,7 @@
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
 				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_OBJC_ARC = YES;
 				CLANG_WARN_EMPTY_BODY = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
@@ -1216,6 +1217,7 @@
 				ALWAYS_SEARCH_USER_PATHS = NO;
 				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
 				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_OBJC_ARC = YES;
 				CLANG_WARN_EMPTY_BODY = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = YES;

+ 3 - 10
oxygine/src/core/ios/HttpRequestCocoaTask.mm

@@ -109,7 +109,6 @@ namespace oxygine
 			NSURLSessionConfiguration* config = [NSURLSessionConfiguration defaultSessionConfiguration];
 			_sessionConfigCommonInit(config);
 			__defaultSession = [NSURLSession sessionWithConfiguration:config delegate:_cls delegateQueue:nil];
-			[__defaultSession retain];
 		}
 		return __defaultSession;
 	}
@@ -125,7 +124,6 @@ namespace oxygine
 			config.HTTPCookieStorage = nil;
 			
 			__ephemeralSession = [NSURLSession sessionWithConfiguration:config delegate:_cls delegateQueue:nil];
-			[__ephemeralSession retain];
 		}
 		return __ephemeralSession;
 	}
@@ -144,14 +142,9 @@ namespace oxygine
 		if (--_httpRequestTaskInitialized)
 			return;
 		
-		[__defaultSession release];
-		__defaultSession = NULL;
-		
-		[__ephemeralSession release];
-		__ephemeralSession = NULL;
-		
-		[_cls release];
-		_cls = NULL;
+		__defaultSession = nil;
+		__ephemeralSession = nil;
+		_cls = nil;
     }
     
     spHttpRequestTask HttpRequestTask::create()