Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Wraps fake simulator setup in an autorelease pool #62

Merged
merged 1 commit into from

2 participants

@akitchen
Owner

Fixes possible leak under iOS versions prior to 6

objc[84078]: Object 0x6d27670 of class __NSCFString autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug
objc[84078]: Object 0x6d273f0 of class __NSArrayM autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug

@idoru
Owner

Thanks for fixing this!

@idoru idoru merged commit be5355d into pivotal:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 25, 2013
  1. Wraps the fake simulator setup in an autorelase pool

    Andrew Kitchen and Philip Kuryloski authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  Source/iPhone/HeadlessSimulatorWorkaround.m
View
2  Source/iPhone/HeadlessSimulatorWorkaround.m
@@ -3,6 +3,7 @@
void setUpFakeWorkspaceIfRequired() {
#if TARGET_IPHONE_SIMULATOR
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSString *systemVersion = [[UIDevice currentDevice] systemVersion];
NSInteger majorVersion = [[[systemVersion componentsSeparatedByString:@"."] objectAtIndex:0] integerValue];
if (majorVersion >= 6 && CFMessagePortCreateRemote(NULL, (CFStringRef)@"PurpleWorkspacePort") == NULL) {
@@ -10,5 +11,6 @@ void setUpFakeWorkspaceIfRequired() {
CFMessagePortCreateLocal(NULL, (CFStringRef)@"PurpleWorkspacePort", NULL, NULL, NULL);
class_replaceMethod([UIWindow class], @selector(_createContext), imp_implementationWithBlock(^{}), "v@:");
}
+ [pool drain];
#endif
}
Something went wrong with that request. Please try again.