Osx 10.6 woes

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.

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


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

Ok, I may rewrite my program so that I load things in a separate thread,
but if I could slap an autorelease pool in there and have things work
(and be reasonably robust) that would be the best option. Does anyone
have any quick sample code on what sort of autorelease pool I need?
Otherwise I’ll google around and just try to figure it out.On 12/11/2010 10:27 PM, Eric Wing wrote:

On 12/11/10, jon <@jon> 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.

For what its worth, I tried making my own allocation pool in the new
thread but I got a bus error. I bit the bullet and reorganized my code
so that loading resources occurs in a separate thread and the main
thread will display the loading message.On 12/11/2010 10:34 PM, jon wrote:

On 12/11/2010 10:27 PM, Eric Wing wrote:

On 12/11/10, jon <@jon> 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.

Ok, I may rewrite my program so that I load things in a separate thread,
but if I could slap an autorelease pool in there and have things work
(and be reasonably robust) that would be the best option. Does anyone
have any quick sample code on what sort of autorelease pool I need?
Otherwise I’ll google around and just try to figure it out.

Hi friends:

Well, i’m developing a program create with C++, this program is a daemon,
i mean, the program will start in the background when the system start
(linux), this daemon will check a several things on the system and if some
of these things that the program will check happens the daemon have to
play a sound, for this i’m using SDL_Mixer, and if I execute the program
manually he play the sound (wav), but if I put th program in daemon form
when he try to init de SDL_mixer he get out and stop working.

My question is, is possible that I can not use the SDL_mixer for do this
from a program when is a daemon?.