From 2fb0517e920d172c853533fda79aa1a6256f6826 Mon Sep 17 00:00:00 2001 From: Jean-Paul Saman Date: Mon, 25 May 2009 00:25:47 +0200 Subject: [PATCH] macosx: release allocated objects. --- modules/gui/macosx/misc.m | 10 ++++++++-- modules/gui/macosx/simple_prefs.m | 7 +++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m index 4d77a3824b..fe7b507756 100644 --- a/modules/gui/macosx/misc.m +++ b/modules/gui/macosx/misc.m @@ -91,7 +91,7 @@ @implementation NSAnimation (VLCAdditions) /* fake class attributes */ -static NSMapTable *VLCAdditions_userInfo = NULL; +static NSMapTable *VLCAdditions_userInfo = nil; + (void)load { @@ -124,7 +124,7 @@ static NSMapTable *VLCAdditions_userInfo = NULL; @implementation NSScreen (VLCAdditions) -static NSMutableArray *blackoutWindows = NULL; +static NSMutableArray *blackoutWindows = nil; + (void)load { @@ -132,6 +132,12 @@ static NSMutableArray *blackoutWindows = NULL; blackoutWindows = [[NSMutableArray alloc] initWithCapacity:1]; } +- (void)dealloc +{ + [blackoutWindows release]; + [super dealloc]; +} + + (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID { int i; diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m index 30379244dd..debf9efd70 100644 --- a/modules/gui/macosx/simple_prefs.m +++ b/modules/gui/macosx/simple_prefs.m @@ -661,7 +661,11 @@ static inline void save_string_list( intf_thread_t * p_intf, id object, const ch p_item = config_FindConfig( VLC_OBJECT(p_intf), name ); p_stringobject = (NSString *)[[object selectedItem] representedObject]; assert([p_stringobject isKindOfClass:[NSString class]]); - if( p_stringobject ) config_PutPsz( p_intf, name, [p_stringobject UTF8String] ); + if( p_stringobject ) + { + config_PutPsz( p_intf, name, [p_stringobject UTF8String] ); + [p_stringobject release]; + } } static inline void save_module_list( intf_thread_t * p_intf, id object, const char * name ) @@ -694,7 +698,6 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch { char *psz_tmp; int i; - NSString *p_stringobject; #define SaveIntList( object, name ) save_int_list( p_intf, object, name ) -- 2.20.1