Memory leak when changing scene (renderers)

Hi all, when I change my renderers (say from a game menu scene to the level 1 of the game), I receive the following output to the error stream:

2004-06-21 00:16:13.459 java[502] *** _NSAutoreleaseNoPool(): Object 0x931ce00 of class NSSurface autoreleased with no pool in place - just leaking

The following is my main application’s method for changing scenes:

and the currentScene.shutDown() and currentScene.startUp() are as follows:

currentScene.startUp()

currentScene.shutDown()

I’m sure that I’m just missing out one line, or have something a little mixed up. I’ve been through all the combinations of calls that I can think of, but always end up with the same memory leak. :confused:

I look forward to hearing any thoughts you may have!

Cocoa uses object pools for autorelasing objects. On main cocoa thread there is a pool created for you automatically, but other threads need to create their own. It seems that we do things (pretty much anything using cocoa APIs) on a non cocoa thread that needs a release pool.

I’ll look into that.

cheers

Well, good news (I think)… I updated to Java 1.4.2 Update 1 Developer Preview 2 and the memory leak issue has now disappeared! I was a little hesitant to upgrade to this version, as the last time I upgraded to it - Java no longer worked and I had to reinstall the entire system - something which don’t have the time to do atm (although it would only take 3 or so hours to get everything back to normal).

Can’t wait to see what updates there will be in developer preview 3! :smiley: