mirror of https://github.com/stella-emu/stella.git
Convert to ARC.
This commit is contained in:
parent
d63f68508f
commit
0f3648ee09
|
@ -38,10 +38,7 @@ static AboutBox *sharedInstance = nil;
|
|||
|
||||
- (id)init
|
||||
{
|
||||
if (sharedInstance)
|
||||
[self release];
|
||||
else
|
||||
sharedInstance = [super init];
|
||||
if (!sharedInstance) sharedInstance = [super init];
|
||||
|
||||
return sharedInstance;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ static Preferences *sharedInstance = nil;
|
|||
- (id)init
|
||||
{
|
||||
if (self = [super init]) {
|
||||
defaults = [[NSUserDefaults standardUserDefaults] retain];
|
||||
defaults = [NSUserDefaults standardUserDefaults];
|
||||
sharedInstance = self;
|
||||
}
|
||||
return(self);
|
||||
|
@ -57,42 +57,39 @@ static Preferences *sharedInstance = nil;
|
|||
|
||||
- (void)dealloc
|
||||
{
|
||||
[defaults release];
|
||||
if (self == sharedInstance) {
|
||||
sharedInstance = nil;
|
||||
}
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (void)setString:(const char *)key : (const char *)value
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSString* theKey = [NSString stringWithCString:key encoding:NSUTF8StringEncoding];
|
||||
NSString* theValue = [NSString stringWithCString:value encoding:NSUTF8StringEncoding];
|
||||
@autoreleasepool {
|
||||
NSString* theKey = [NSString stringWithCString:key encoding:NSUTF8StringEncoding];
|
||||
NSString* theValue = [NSString stringWithCString:value encoding:NSUTF8StringEncoding];
|
||||
|
||||
[defaults setObject:theValue forKey:theKey];
|
||||
[pool release];
|
||||
[defaults setObject:theValue forKey:theKey];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)getString:(const char *)key : (char *)value : (int)size
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
NSString* theKey = [NSString stringWithCString:key encoding:NSUTF8StringEncoding];
|
||||
NSString* theValue = [defaults objectForKey:theKey];
|
||||
if (theValue != nil)
|
||||
strncpy(value, [theValue cStringUsingEncoding: NSUTF8StringEncoding], size);
|
||||
else
|
||||
value[0] = 0;
|
||||
|
||||
[pool release];
|
||||
@autoreleasepool {
|
||||
NSString* theKey = [NSString stringWithCString:key encoding:NSUTF8StringEncoding];
|
||||
NSString* theValue = [defaults objectForKey:theKey];
|
||||
if (theValue != nil)
|
||||
strncpy(value, [theValue cStringUsingEncoding: NSUTF8StringEncoding], size);
|
||||
else
|
||||
value[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)save
|
||||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
[defaults synchronize];
|
||||
[pool release];
|
||||
@autoreleasepool {
|
||||
[defaults synchronize];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -3014,6 +3014,7 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
|
@ -3067,6 +3068,7 @@
|
|||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
|
|
Loading…
Reference in New Issue