Commit bb15c815 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: switch to automated reference counting (refs #2813)

parent 66038325
......@@ -39,8 +39,6 @@
-(void)dealloc
{
addon_entry_Release(p_addon_entry);
[super dealloc];
}
- (NSData *)uuid
......
......@@ -44,7 +44,7 @@
static void addonsEventsCallback( const vlc_event_t *event, void *data )
{
AddonsWindowController *controller = data;
AddonsWindowController *controller = (__bridge AddonsWindowController *)data;
@autoreleasepool {
if (event->type == vlc_AddonFound)
......@@ -73,11 +73,8 @@ static void addonsEventsCallback( const vlc_event_t *event, void *data )
- (void)dealloc
{
[_addons release];
[_displayedAddons release];
if (_manager)
addons_manager_Delete(_manager);
[super dealloc];
}
#pragma mark - UI handling
......@@ -125,9 +122,9 @@ static void addonsEventsCallback( const vlc_event_t *event, void *data )
return;
vlc_event_manager_t *p_em = _manager->p_event_manager;
vlc_event_attach(p_em, vlc_AddonFound, addonsEventsCallback, self);
vlc_event_attach(p_em, vlc_AddonsDiscoveryEnded, addonsEventsCallback, self);
vlc_event_attach(p_em, vlc_AddonChanged, addonsEventsCallback, self);
vlc_event_attach(p_em, vlc_AddonFound, addonsEventsCallback, (__bridge void *)self);
vlc_event_attach(p_em, vlc_AddonsDiscoveryEnded, addonsEventsCallback, (__bridge void *)self);
vlc_event_attach(p_em, vlc_AddonChanged, addonsEventsCallback, (__bridge void *)self);
[self _findInstalled];
}
......@@ -231,7 +228,7 @@ static void addonsEventsCallback( const vlc_event_t *event, void *data )
addon_entry_t *p_entry = [o_value pointerValue];
/* no skin support on OS X so far */
if (p_entry->e_type != ADDON_SKIN2)
[_addons addObject:[[[VLCAddon alloc] initWithAddon:p_entry] autorelease]];
[_addons addObject:[[VLCAddon alloc] initWithAddon:p_entry]];
}
- (void)discoveryEnded
......@@ -277,11 +274,7 @@ static void addonsEventsCallback( const vlc_event_t *event, void *data )
}
}
if (_displayedAddons)
[_displayedAddons release];
_displayedAddons = [NSArray arrayWithArray:filteredItems];
[_displayedAddons retain];
[filteredItems release];
// update ui
[_addonsTable reloadData];
......
......@@ -77,9 +77,7 @@ static AppleRemote *_o_sharedInstance = nil;
- (id)init
{
if (_o_sharedInstance) {
[self dealloc];
} else {
if (!_o_sharedInstance) {
_o_sharedInstance = [super init];
_openInExclusiveMode = YES;
queue = NULL;
......@@ -107,7 +105,6 @@ static AppleRemote *_o_sharedInstance = nil;
[mutableCookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched] forKey:@"42_33_23_21_20_2_33_23_21_20_2_"];
_cookieToButtonMapping = [[NSDictionary alloc] initWithDictionary: mutableCookieToButtonMapping];
[mutableCookieToButtonMapping release];
/* defaults */
_simulatePlusMinusHold = YES;
......@@ -119,8 +116,6 @@ static AppleRemote *_o_sharedInstance = nil;
- (void) dealloc {
[self stopListening:self];
[_cookieToButtonMapping release];
[super dealloc];
}
- (int) remoteId {
......@@ -189,7 +184,6 @@ static AppleRemote *_o_sharedInstance = nil;
AppleRemoteApplicationDelegate* appDelegate = (AppleRemoteApplicationDelegate*)[NSApp delegate];
id previousAppDelegate = [appDelegate applicationDelegate];
[NSApp setDelegate: previousAppDelegate];
[appDelegate release];
}
}
......@@ -238,7 +232,6 @@ cleanup:
}
if (_allCookies != nil) {
[_allCookies autorelease];
_allCookies = nil;
}
......@@ -278,18 +271,6 @@ static AppleRemote* sharedInstance=nil;
- (id)copyWithZone:(NSZone *)zone {
return self;
}
- (id)retain {
return self;
}
- (NSUInteger)retainCount {
return UINT_MAX; //denotes an object that cannot be released
}
- (void)release {
//do nothing
}
- (id)autorelease {
return self;
}
@end
......@@ -450,7 +431,7 @@ static AppleRemote* sharedInstance=nil;
Will be called for any event of any type (cookie) to which we subscribe
*/
static void QueueCallbackFunction(void* target, IOReturn result, void* refcon, void* sender) {
AppleRemote* remote = (AppleRemote*)target;
AppleRemote* remote = (__bridge AppleRemote*)target;
IOHIDEventStruct event;
AbsoluteTime zeroTime = {0,0};
......@@ -544,8 +525,8 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
long usage;
long usagePage;
id object;
NSArray* elements;
NSDictionary* element;
CFArrayRef elementsRef;
IOReturn success;
if (!handle || !(*handle)) return NO;
......@@ -554,9 +535,11 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
* for this device anyway, and thus, it's faster to iterate them
* ourselves. When grabbing only one or two elements, a matching
* dictionary should be passed in here instead of NULL. */
success = (*handle)->copyMatchingElements(handle, NULL, (CFArrayRef*)&elements);
success = (*handle)->copyMatchingElements(handle, NULL, &elementsRef);
if (success == kIOReturnSuccess) {
NSArray *elements = (__bridge NSArray *)elementsRef;
/*
cookies = calloc(NUMBER_OF_APPLE_REMOTE_ACTIONS, sizeof(IOHIDElementCookie));
memset(cookies, 0, sizeof(IOHIDElementCookie) * NUMBER_OF_APPLE_REMOTE_ACTIONS);
......@@ -569,7 +552,7 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
//Get cookie
object = [element valueForKey: (NSString*)CFSTR(kIOHIDElementCookieKey) ];
if (object == nil || ![object isKindOfClass:[NSNumber class]]) continue;
if (object == 0 || CFGetTypeID(object) != CFNumberGetTypeID()) continue;
if (object == 0 || CFGetTypeID((__bridge CFTypeRef)(object)) != CFNumberGetTypeID()) continue;
cookie = (IOHIDElementCookie) [object longValue];
//Get usage
......@@ -585,14 +568,14 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
[mutableAllCookies addObject: [NSNumber numberWithInt:(int)cookie]];
}
_allCookies = [[NSArray alloc] initWithArray: mutableAllCookies];
[mutableAllCookies release];
[elements release];
} else {
if (elements)
[elements release];
if (elementsRef)
CFRelease(elementsRef);
return NO;
}
if (elementsRef)
CFRelease(elementsRef);
return YES;
}
......@@ -617,7 +600,7 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
// add callback for async events
ioReturnValue = (*queue)->createAsyncEventSource(queue, &eventSource);
if (ioReturnValue == KERN_SUCCESS) {
ioReturnValue = (*queue)->setEventCallout(queue,QueueCallbackFunction, self, NULL);
ioReturnValue = (*queue)->setEventCallout(queue,QueueCallbackFunction, (__bridge void *)(self), NULL);
if (ioReturnValue == KERN_SUCCESS) {
CFRunLoopAddSource(CFRunLoopGetCurrent(), eventSource, kCFRunLoopDefaultMode);
//start data delivery to queue
......@@ -642,15 +625,10 @@ static void QueueCallbackFunction(void* target, IOReturn result, void* refcon,
- (id) initWithApplicationDelegate: (id) delegate {
if((self = [super init]))
applicationDelegate = [delegate retain];
applicationDelegate = delegate;
return self;
}
- (void) dealloc {
[applicationDelegate release];
[super dealloc];
}
- (id) applicationDelegate {
return applicationDelegate;
}
......
......@@ -85,18 +85,11 @@ static VLCAudioEffects *_o_sharedInstance = nil;
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:[NSArray arrayWithArray:workValues], @"EQValues", [NSArray arrayWithArray:workPreamp], @"EQPreampValues", [NSArray arrayWithArray:workTitles], @"EQTitles", [NSArray arrayWithArray:workNames], @"EQNames", [NSArray arrayWithObject:defaultProfile], @"AudioEffectProfiles", [NSArray arrayWithObject:_NS("Default")], @"AudioEffectProfileNames", nil];
[defaults registerDefaults:appDefaults];
[workValues release];
[workPreamp release];
[workTitles release];
[workNames release];
}
- (id)init
{
if (_o_sharedInstance)
[self dealloc];
else {
if (!_o_sharedInstance) {
p_intf = VLCIntf;
i_old_profile_index = -1;
_o_sharedInstance = [super init];
......@@ -257,7 +250,6 @@ static VLCAudioEffects *_o_sharedInstance = nil;
[workArray replaceObjectAtIndex:i_old_profile_index withObject:newProfile];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"AudioEffectProfiles"];
[workArray release];
[defaults synchronize];
}
......@@ -629,19 +621,15 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
NSMutableArray *workArray = [[NSMutableArray alloc] initWithArray:[defaults objectForKey:@"EQValues"]];
[workArray addObject:[self generatePresetString]];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"EQValues"];
[workArray release];
workArray = [[NSMutableArray alloc] initWithArray:[defaults objectForKey:@"EQTitles"]];
[workArray addObject:text];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"EQTitles"];
[workArray release];
workArray = [[NSMutableArray alloc] initWithArray:[defaults objectForKey:@"EQPreampValues"]];
[workArray addObject:[NSString stringWithFormat:@"%.1f", [o_eq_preamp_sld floatValue]]];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"EQPreampValues"];
[workArray release];
workArray = [[NSMutableArray alloc] initWithArray:[defaults objectForKey:@"EQNames"]];
[workArray addObject:[text decomposedStringWithCanonicalMapping]];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"EQNames"];
[workArray release];
[defaults synchronize];
/* update VLC internals */
......@@ -671,7 +659,7 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
if ([text length] == 0 || [profileNames containsObject:text]) {
[o_profile_pop selectItemAtIndex:[defaults integerForKey:@"AudioEffectSelectedProfile"]];
NSAlert *alert = [[[NSAlert alloc] init] autorelease];
NSAlert *alert = [[NSAlert alloc] init];
[alert setAlertStyle:NSCriticalAlertStyle];
[alert setMessageText:_NS("Please enter a unique name for the new profile.")];
[alert setInformativeText:_NS("Multiple profiles with the same name are not allowed.")];
......@@ -691,11 +679,9 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
[workArray addObject:newProfile];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"AudioEffectProfiles"];
[defaults setInteger:[workArray count] - 1 forKey:@"AudioEffectSelectedProfile"];
[workArray release];
workArray = [[NSMutableArray alloc] initWithArray:[defaults objectForKey:@"AudioEffectProfileNames"]];
[workArray addObject:text];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"AudioEffectProfileNames"];
[workArray release];
/* save defaults */
[defaults synchronize];
......@@ -726,19 +712,15 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
NSMutableArray *workArray = [[NSMutableArray alloc] initWithArray:[defaults objectForKey:@"EQValues"]];
[workArray removeObjectAtIndex:item];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"EQValues"];
[workArray release];
workArray = [[NSMutableArray alloc] initWithArray:[defaults objectForKey:@"EQTitles"]];
[workArray removeObjectAtIndex:item];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"EQTitles"];
[workArray release];
workArray = [[NSMutableArray alloc] initWithArray:[defaults objectForKey:@"EQPreampValues"]];
[workArray removeObjectAtIndex:item];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"EQPreampValues"];
[workArray release];
workArray = [[NSMutableArray alloc] initWithArray:[defaults objectForKey:@"EQNames"]];
[workArray removeObjectAtIndex:item];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"EQNames"];
[workArray release];
[defaults synchronize];
}
......@@ -756,11 +738,9 @@ static bool GetEqualizerStatus(intf_thread_t *p_custom_intf,
NSMutableArray *workArray = [[NSMutableArray alloc] initWithArray:[defaults objectForKey:@"AudioEffectProfiles"]];
[workArray removeObjectAtIndex:item];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"AudioEffectProfiles"];
[workArray release];
workArray = [[NSMutableArray alloc] initWithArray:[defaults objectForKey:@"AudioEffectProfileNames"]];
[workArray removeObjectAtIndex:item];
[defaults setObject:[NSArray arrayWithArray:workArray] forKey:@"AudioEffectProfileNames"];
[workArray release];
if (i_old_profile_index >= item)
[defaults setInteger:i_old_profile_index - 1 forKey:@"AudioEffectSelectedProfile"];
......
......@@ -120,7 +120,7 @@ typedef enum CrashReportStatus {
NSMutableString *_contentOfProperty;
id<BWQuincyManagerDelegate> _delegate;
id<BWQuincyManagerDelegate> __weak _delegate;
NSString *_submissionURL;
NSString *_companyName;
......@@ -143,7 +143,7 @@ typedef enum CrashReportStatus {
@property (nonatomic, retain) NSString *companyName;
// delegate is required
@property (nonatomic, assign) id <BWQuincyManagerDelegate> delegate;
@property (nonatomic, weak) id <BWQuincyManagerDelegate> delegate;
// if YES, the crash report will be submitted without asking the user
// if NO, the user will be asked if the crash report can be submitted (default)
......
......@@ -54,7 +54,6 @@
@implementation BWQuincyManager
@synthesize delegate = _delegate;
@synthesize submissionURL = _submissionURL;
@synthesize companyName = _companyName;
@synthesize appIdentifier = _appIdentifier;
......@@ -91,13 +90,6 @@
_delegate = nil;
_submissionURL = nil;
_appIdentifier = nil;
[_crashFile release];
[_quincyUI release];
if (_customAppVersion)
[_customAppVersion release];
[super dealloc];
}
- (void) searchCrashLogFile:(NSString *)path {
......@@ -114,7 +106,7 @@
[filesWithModificationDate addObject:[NSDictionary dictionaryWithObjectsAndKeys:crashFile,@"name",crashLogPath,@"path",modDate,@"modDate",nil]];
}
NSSortDescriptor* dateSortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"modDate" ascending:YES] autorelease];
NSSortDescriptor* dateSortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"modDate" ascending:YES];
NSArray* sortedFiles = [filesWithModificationDate sortedArrayUsingDescriptors:[NSArray arrayWithObject:dateSortDescriptor]];
NSPredicate* filterPredicate = [NSPredicate predicateWithFormat:@"name BEGINSWITH %@", [self applicationName]];
......@@ -127,7 +119,6 @@
#pragma mark setter
- (void)setSubmissionURL:(NSString *)anSubmissionURL {
if (_submissionURL != anSubmissionURL) {
[_submissionURL release];
_submissionURL = [anSubmissionURL copy];
}
......@@ -136,7 +127,6 @@
- (void)setAppIdentifier:(NSString *)anAppIdentifier {
if (_appIdentifier != anAppIdentifier) {
[_appIdentifier release];
_appIdentifier = [anAppIdentifier copy];
}
......@@ -368,8 +358,6 @@
[parser setShouldResolveExternalEntities:NO];
[parser parse];
[parser release];
}
}
}
......@@ -435,7 +423,6 @@
- (void)setApplicationVersion:(NSString *)appVersion
{
_customAppVersion = appVersion;
[_customAppVersion retain];
}
- (NSString *) applicationVersion {
......
......@@ -153,7 +153,6 @@ const CGFloat kDetailsHeight = 285;
NSString *notes = [NSString stringWithFormat:@"Comments:\n%@\n\nConsole:\n%@", [descriptionTextField stringValue], _consoleContent];
[_quincyManager sendReportCrash:_crashLogContent description:notes];
[_crashLogContent release];
_crashLogContent = nil;
}
......@@ -181,7 +180,7 @@ const CGFloat kDetailsHeight = 285;
NSString *crashLogs = [NSString stringWithContentsOfFile:_crashFile encoding:NSUTF8StringEncoding error:&error];
NSString *lastCrash = [[crashLogs componentsSeparatedByString: @"**********\n\n"] lastObject];
_crashLogContent = [lastCrash retain];
_crashLogContent = lastCrash;
// get the console log
NSEnumerator *theEnum = [[[NSString stringWithContentsOfFile:@"/private/var/log/system.log" encoding:NSUTF8StringEncoding error:&error] componentsSeparatedByString: @"\n"] objectEnumerator];
......@@ -212,16 +211,6 @@ const CGFloat kDetailsHeight = 285;
[NSApp runModalForWindow:[self window]];
}
- (void)dealloc {
[_consoleContent release]; _consoleContent = nil;
_companyName = nil;
_quincyManager = nil;
[super dealloc];
}
- (BOOL)showComments {
return showComments;
}
......
......@@ -77,10 +77,10 @@
[o_bwd_btn setImage: imageFromRes(@"backward-3btns")];
[o_bwd_btn setAlternateImage: imageFromRes(@"backward-3btns-pressed")];
o_play_img = [imageFromRes(@"play") retain];
o_play_pressed_img = [imageFromRes(@"play-pressed") retain];
o_pause_img = [imageFromRes(@"pause") retain];
o_pause_pressed_img = [imageFromRes(@"pause-pressed") retain];
o_play_img = imageFromRes(@"play");
o_play_pressed_img = imageFromRes(@"play-pressed");
o_pause_img = imageFromRes(@"pause");
o_pause_pressed_img = imageFromRes(@"pause-pressed");
[o_fwd_btn setImage: imageFromRes(@"forward-3btns")];
[o_fwd_btn setAlternateImage: imageFromRes(@"forward-3btns-pressed")];
......@@ -94,10 +94,10 @@
[o_bwd_btn setImage: imageFromRes(@"backward-3btns-dark")];
[o_bwd_btn setAlternateImage: imageFromRes(@"backward-3btns-dark-pressed")];
o_play_img = [imageFromRes(@"play_dark") retain];
o_play_pressed_img = [imageFromRes(@"play-pressed_dark") retain];
o_pause_img = [imageFromRes(@"pause_dark") retain];
o_pause_pressed_img = [imageFromRes(@"pause-pressed_dark") retain];
o_play_img = imageFromRes(@"play_dark");
o_play_pressed_img = imageFromRes(@"play-pressed_dark");
o_pause_img = imageFromRes(@"pause_dark");
o_pause_pressed_img = imageFromRes(@"pause-pressed_dark");
[o_fwd_btn setImage: imageFromRes(@"forward-3btns-dark")];
[o_fwd_btn setAlternateImage: imageFromRes(@"forward-3btns-dark-pressed")];
......@@ -360,7 +360,6 @@
- (void)drawFancyGradientEffectForTimeSlider
{
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
CGFloat f_value = [o_time_sld knobPosition];
if (f_value > 7.5) {
NSRect oldFrame = [o_time_sld_fancygradient_view frame];
......@@ -378,7 +377,6 @@
}
[o_time_sld_fancygradient_view setHidden: YES];
}
[o_pool release];
}
- (void)updateControls
......@@ -447,14 +445,6 @@
[o_fullscreen_btn setState:b_fullscreen];
}
- (void)dealloc {
[o_play_img release];
[o_play_pressed_img release];
[o_pause_img release];
[o_pause_pressed_img release];
[super dealloc];
}
@end
......@@ -514,16 +504,16 @@
[o_playlist_btn setImage: imageFromRes(@"playlist-btn")];
[o_playlist_btn setAlternateImage: imageFromRes(@"playlist-btn-pressed")];
o_repeat_img = [imageFromRes(@"repeat") retain];
o_repeat_pressed_img = [imageFromRes(@"repeat-pressed") retain];
o_repeat_all_img = [imageFromRes(@"repeat-all") retain];
o_repeat_all_pressed_img = [imageFromRes(@"repeat-all-pressed") retain];
o_repeat_one_img = [imageFromRes(@"repeat-one") retain];
o_repeat_one_pressed_img = [imageFromRes(@"repeat-one-pressed") retain];
o_shuffle_img = [imageFromRes(@"shuffle") retain];
o_shuffle_pressed_img = [imageFromRes(@"shuffle-pressed") retain];
o_shuffle_on_img = [imageFromRes(@"shuffle-blue") retain];
o_shuffle_on_pressed_img = [imageFromRes(@"shuffle-blue-pressed") retain];
o_repeat_img = imageFromRes(@"repeat");
o_repeat_pressed_img = imageFromRes(@"repeat-pressed");
o_repeat_all_img = imageFromRes(@"repeat-all");
o_repeat_all_pressed_img = imageFromRes(@"repeat-all-pressed");
o_repeat_one_img = imageFromRes(@"repeat-one");
o_repeat_one_pressed_img = imageFromRes(@"repeat-one-pressed");
o_shuffle_img = imageFromRes(@"shuffle");
o_shuffle_pressed_img = imageFromRes(@"shuffle-pressed");
o_shuffle_on_img = imageFromRes(@"shuffle-blue");
o_shuffle_on_pressed_img = imageFromRes(@"shuffle-blue-pressed");
[o_volume_down_btn setImage: imageFromRes(@"volume-low")];
[o_volume_track_view setImage: imageFromRes(@"volume-slider-track")];
......@@ -546,16 +536,16 @@
[o_playlist_btn setImage: imageFromRes(@"playlist_dark")];
[o_playlist_btn setAlternateImage: imageFromRes(@"playlist-pressed_dark")];
o_repeat_img = [imageFromRes(@"repeat_dark") retain];
o_repeat_pressed_img = [imageFromRes(@"repeat-pressed_dark") retain];
o_repeat_all_img = [imageFromRes(@"repeat-all-blue_dark") retain];
o_repeat_all_pressed_img = [imageFromRes(@"repeat-all-blue-pressed_dark") retain];
o_repeat_one_img = [imageFromRes(@"repeat-one-blue_dark") retain];
o_repeat_one_pressed_img = [imageFromRes(@"repeat-one-blue-pressed_dark") retain];
o_shuffle_img = [imageFromRes(@"shuffle_dark") retain];
o_shuffle_pressed_img = [imageFromRes(@"shuffle-pressed_dark") retain];
o_shuffle_on_img = [imageFromRes(@"shuffle-blue_dark") retain];
o_shuffle_on_pressed_img = [imageFromRes(@"shuffle-blue-pressed_dark") retain];
o_repeat_img = imageFromRes(@"repeat_dark");
o_repeat_pressed_img = imageFromRes(@"repeat-pressed_dark");
o_repeat_all_img = imageFromRes(@"repeat-all-blue_dark");
o_repeat_all_pressed_img = imageFromRes(@"repeat-all-blue-pressed_dark");
o_repeat_one_img = imageFromRes(@"repeat-one-blue_dark");
o_repeat_one_pressed_img = imageFromRes(@"repeat-one-blue-pressed_dark");
o_shuffle_img = imageFromRes(@"shuffle_dark");
o_shuffle_pressed_img = imageFromRes(@"shuffle-pressed_dark");
o_shuffle_on_img = imageFromRes(@"shuffle-blue_dark");
o_shuffle_on_pressed_img = imageFromRes(@"shuffle-blue-pressed_dark");
[o_volume_down_btn setImage: imageFromRes(@"volume-low_dark")];
[o_volume_track_view setImage: imageFromRes(@"volume-slider-track_dark")];
......@@ -862,10 +852,8 @@ else \
}
[o_prev_btn removeFromSuperviewWithoutNeedingDisplay];
[o_next_btn removeFromSuperviewWithoutNeedingDisplay];
[o_prev_btn release];
o_prev_btn = NULL;
[o_next_btn release];
o_next_btn = NULL;
o_prev_btn = nil;
o_next_btn = nil;
NSRect frame;
frame = [o_bwd_btn frame];
......@@ -1150,18 +1138,4 @@ else \
[[VLCMainMenu sharedInstance] setRateControlsEnabled: b_control];
}
- (void)dealloc {
[o_repeat_img release];
[o_repeat_pressed_img release];
[o_repeat_all_img release];
[o_repeat_all_pressed_img release];
[o_repeat_one_img release];
[o_repeat_one_pressed_img release];
[o_shuffle_img release];
[o_shuffle_pressed_img release];
[o_shuffle_on_img release];
[o_shuffle_on_pressed_img release];
[super dealloc];
}
@end
......@@ -113,8 +113,6 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:defaultProfiles, @"CASProfiles", defaultProfileNames, @"CASProfileNames", nil];
[defaults registerDefaults:appDefaults];
[defaultProfiles release];
[defaultProfileNames release];
}
+ (VLCConvertAndSave *)sharedInstance
......@@ -124,29 +122,12 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
- (id)init
{
if (_o_sharedInstance) {
[self dealloc];
} else {
if (!_o_sharedInstance)
_o_sharedInstance = [super init];
}
return _o_sharedInstance;
}
- (void)dealloc
{
if (_currentProfile)
[_currentProfile release];
[_profileNames release];
[_profileValueList release];
[_videoCodecs release];
[_audioCodecs release];
[_subsCodecs release];
[super dealloc];
}
- (void)awakeFromNib
{
[_window setTitle: _NS("Convert & Stream")];
......@@ -209,7 +190,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[_stream_sdp_matrix setEnabled:NO];
/* there is no way to hide single cells, so replace the existing ones with empty cells.. */
id blankCell = [[[NSCell alloc] init] autorelease];
id blankCell = [[NSCell alloc] init];
[blankCell setEnabled:NO];
[_customize_encap_matrix putCell:blankCell atRow:3 column:1];
[_customize_encap_matrix putCell:blankCell atRow:3 column:2];
......@@ -475,7 +456,6 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[labelContent appendFormat:@" (\"%@\")", [_stream_channel_fld stringValue]];
[_destination_stream_lbl setStringValue:labelContent];
[labelContent release];
/* catch obvious errors */
if (![[_stream_address_fld stringValue] length] > 0) {
......@@ -608,13 +588,11 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
/* add profile to arrays */
NSMutableArray * workArray = [[NSMutableArray alloc] initWithArray:self.profileNames];
[workArray addObject:text];
[self setProfileNames:[[[NSArray alloc] initWithArray:workArray] autorelease]];
[workArray release];
[self setProfileNames:[[NSArray alloc] initWithArray:workArray]];
workArray = [[NSMutableArray alloc] initWithArray:self.profileValueList];
[workArray addObject:[self.currentProfile componentsJoinedByString:@";"]];
[self setProfileValueList:[[[NSArray alloc] initWithArray:workArray] autorelease]];
[workArray release];
[self setProfileValueList:[[NSArray alloc] initWithArray:workArray]];
/* update UI */
[self recreateProfilePopup];
......@@ -633,12 +611,10 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
/* remove requested profile from the arrays */
NSMutableArray * workArray = [[NSMutableArray alloc] initWithArray:self.profileNames];
[workArray removeObjectAtIndex:item];
[self setProfileNames:[[[NSArray alloc] initWithArray:workArray] autorelease]];
[workArray release];
[self setProfileNames:[[NSArray alloc] initWithArray:workArray]];
workArray = [[NSMutableArray alloc] initWithArray:self.profileValueList];
[workArray removeObjectAtIndex:item];
[self setProfileValueList:[[[NSArray alloc] initWithArray:workArray] autorelease]];
[workArray release];
[self setProfileValueList:[[NSArray alloc] initWithArray:workArray]];
/* update UI */
[self recreateProfilePopup];
......@@ -783,7 +759,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[self audioSettingsChanged:nil];
[self subSettingsChanged:nil];
[self setCurrentProfile: [[[NSMutableArray alloc] initWithArray: [profileString componentsSeparatedByString:@";"]] autorelease]];
[self setCurrentProfile: [[NSMutableArray alloc] initWithArray:[profileString componentsSeparatedByString:@";"]]];
}
- (void)selectCellByEncapsulationFormat:(NSString *)format
......@@ -984,10 +960,7 @@ static VLCConvertAndSave *_o_sharedInstance = nil;
[composedOptions appendString:@"} :sout-keep"];
}
NSString * returnString = [NSString stringWithString:composedOptions];
[composedOptions release];
return returnString;
return [NSString stringWithString:composedOptions];
}
- (void)updateCurrentProfile
......
......@@ -50,10 +50,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
- (id)init
{
if (_o_sharedInstance) {
[self dealloc];
return _o_sharedInstance;
} else
if (!_o_sharedInstance)
_o_sharedInstance = [super init];
return _o_sharedInstance;
......@@ -62,7 +59,6 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver: self];
[super dealloc];
}
......@@ -656,8 +652,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
config_PutPsz(VLCIntf, pref, [o_workString UTF8String]); \
b_needsRestart = YES; \
} \
} \