Commit 86027501 authored by Felix Paul Kühne's avatar Felix Paul Kühne
Browse files

macosx: fixed a leak in the Apple Remote class

parent f83ba044
......@@ -108,6 +108,7 @@ The class is not thread safe
IBOutlet id delegate;
}
+ (AppleRemote *)sharedInstance;
- (int) remoteId;
......
......@@ -65,8 +65,19 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4;
#pragma public interface
- (id) init {
if(( self = [super init])) {
static AppleRemote *_o_sharedInstance = nil;
+ (AppleRemote *)sharedInstance
{
return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
}
- (id)init
{
if (_o_sharedInstance) {
[self dealloc];
} else {
_o_sharedInstance = [super init];
openInExclusiveMode = YES;
queue = NULL;
hidDeviceInterface = NULL;
......@@ -124,13 +135,13 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4;
[cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonPlay] forKey:@"33_21_20_8_2_33_21_20_8_2_"];
[cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonFullscreen] forKey:@"33_21_20_3_2_33_21_20_3_2_"];
}
}
/* defaults */
[self setSimulatesPlusMinusHold: YES];
maxClickTimeDifference = DEFAULT_MAXIMUM_CLICK_TIME_DIFFERENCE;
/* defaults */
[self setSimulatesPlusMinusHold: YES];
maxClickTimeDifference = DEFAULT_MAXIMUM_CLICK_TIME_DIFFERENCE;
}
return self;
return _o_sharedInstance;
}
- (void) dealloc {
......
......@@ -516,8 +516,9 @@ static VLCPrefs *_o_sharedMainInstance = nil;
- (id)initWithConfigItem: (module_config_t *) configItem
{
NSString * name = [[[VLCMain sharedInstance] localizedString:configItem->psz_name] autorelease];
NSString * name = [[VLCMain sharedInstance] localizedString:configItem->psz_name];
self = [super initWithName:name];
[name release];
if( self != nil )
{
_configItem = configItem;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment