]> git.sesse.net Git - vlc/commitdiff
macosx: release allocated objects.
authorJean-Paul Saman <jpsaman@videolan.org>
Sun, 24 May 2009 22:25:47 +0000 (00:25 +0200)
committerJean-Paul Saman <jpsaman@videolan.org>
Sun, 24 May 2009 22:25:47 +0000 (00:25 +0200)
modules/gui/macosx/misc.m
modules/gui/macosx/simple_prefs.m

index 4d77a3824b94d39f8b7cfdbd67d1507ee8fff918..fe7b5077568c3e14fbabb8b369514997837e6291 100644 (file)
@@ -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;
index 30379244dd276328baafd06353d79b4df0cb2814..debf9efd70d9d216449fef365715fba317d0e373 100644 (file)
@@ -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 )