[vlc-devel] commit: macosx: release allocated objects. (Jean-Paul Saman )
git version control
git at videolan.org
Tue May 26 01:21:02 CEST 2009
vlc | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Mon May 25 00:25:47 2009 +0200| [2fb0517e920d172c853533fda79aa1a6256f6826] | committer: Jean-Paul Saman
macosx: release allocated objects.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2fb0517e920d172c853533fda79aa1a6256f6826
---
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 4d77a38..fe7b507 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 3037924..debf9ef 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 )
More information about the vlc-devel
mailing list