[SDL] osx 10.6 woes

Eric Wing ewmailing at gmail.com
Sat Dec 11 21:27:13 PST 2010


On 12/11/10, jon <jon.rafkind at gmail.com> wrote:
> I get these warnings at runtime when I run my program in OSX 10.6 with
> SDL 1.2.14
>
> 2010-12-11 21:29:31.762 paintown[55732:1507] ***
> __NSAutoreleaseNoPool(): Object 0x988eb0 of class
> NSWindowGraphicsContext autoreleased with no pool in place - just leaking
> 2010-12-11 21:29:32.025 paintown[55732:1507] ***
> __NSAutoreleaseNoPool(): Object 0x94e0c0 of class
> NSWindowGraphicsContext autoreleased with no pool in place - just leaking
> 2010-12-11 21:29:32.163 paintown[55732:1507] ***
> __NSAutoreleaseNoPool(): Object 0x98dba0 of class
> NSWindowGraphicsContext autoreleased with no pool in place - just leaking
>
> I tried using 3 methods of linking with SDL and it happens with all of them:
>   1. build SDL from source (.tar.gz)
>   2. install SDL with macports
>   3. install the SDL.framework from the .dmg
>
> These warnings come when my application is rendering to the screen in a
> separate thread. When my program loads some data I spawn a new thread to
> display some stuff to the screen (Loading...). I successfully use this
> method in Windows and Linux. Also I was using Allegro as a graphics
> backend until recently and rendering to a separate thread in OSX with
> Allegro worked just fine.
>
> So is this a bug in SDL or is rendering to the screen not allowed at
> all? I haven't narrowed down the code exactly to SDL_Flip() or anything,
> I can try that if no one is sure what exactly is the cause.
>
>

This is most likely because you are trying to draw in another thread.
Cocoa is very particular about its rules about what things can be done
in the non-main-thread and how you can do them. The first thing is
that each thread must have an autorelease pool if you use objects that
require an autorelease pool.

The path of least resistance is to confine your drawing stuff to the
main thread.

-Eric
-- 
Beginning iPhone Games Development
http://playcontrol.net/iphonegamebook/



More information about the SDL mailing list