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

Derk-Jan Hartman hartman at videolan.org
Thu Dec 15 00:24:54 CET 2005


This doesn't seem like the proper way to solve this issue.
Wouldn't it be better to alloc init the date and then release it  
after the sleep ?

why is there even a Cocoa sleep here anyways, a normal sleep() should  
just work fine as well don't you agree ?

Come to think of it, the manageVolumeSlider called there shouldn't be  
their either. the whole manage: function isn't allowed to do any GUI  
work at all.

Same for the seScrollField.

DJ

On 15-dec-2005, at 0:04, jmvallat_vlc at mac.com wrote:

> [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
>
>

-- 
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