[vlc-devel] [PATCH] Abnormal memory growing (macosx)

jmvallat_vlc at mac.com jmvallat_vlc at mac.com
Thu Dec 15 00:04:51 CET 2005


[Mac OS X 10.2.x and later]


To avoid a "large" (time depend) amount of objects to be retained  
until the end of the application, the following patch can be applied.
(Currently, even when idle, the application scrupulously retain at  
least one useless NSDate every 1/10 second...)


Cheers,
JeanMi.
-- 


Index: modules/gui/macosx/intf.m
===================================================================
--- modules/gui/macosx/intf.m   (revision 13740)
+++ modules/gui/macosx/intf.m   (working copy)
@@ -830,6 +830,8 @@
      while( !p_intf->b_die )
      {
+        NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
+
          vlc_mutex_lock( &p_intf->change_lock );
#define p_input p_intf->p_sys->p_input
@@ -864,6 +866,8 @@
          o_sleep_date = [NSDate dateWithTimeIntervalSinceNow: .1];
          [NSThread sleepUntilDate: o_sleep_date];
+
+        [o_pool release];
      }
      [self terminate];



-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list