Re: Leak when "drawing too fast"
Re: Leak when "drawing too fast"
- Subject: Re: Leak when "drawing too fast"
- From: Uli Kusterer <email@hidden>
- Date: Wed, 10 Jul 2013 02:10:23 +0200
On Jul 8, 2013, at 20:28, Andreas Mayer <email@hidden> wrote:
> It seems like when I call -setNeedsDisplay:YES the system is spawning a timer to do something later on and when those calls come in too fast, that timer is leaked.
>
> Any idea what I could do about that?
> (I tried calling -setNeedsDisplay:YES only if -needsDisplay is NO which didn't help.)
>
> Is there a way I can draw as fast as possible without triggering this problem?
I don’t think the timers leak. Instead, I think they probably just queue up on the event loop because their fire interval is greater than that at which you add new timers by calling setNeedsDisplay. Could that be it?
FWIW, I remember hearing at some WWDC that MacOS X caps its drawing at a certain frequency. I think it was either 60Hz or 60fps, not sure anymore. So my guess is it’s not worth trying to draw any faster because the back buffer is only flushed to the screen at this slower interval anyway.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden