[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Re: Pygame app on Mac



On Mar 17, 2005, at 3:39, Jack Nutting wrote:

On Thu, 17 Mar 2005 00:08:20 +0100, Jindra Sarson <jindra@xxxxxxxxx> wrote:
but it's not that case. I tried it on simple examples delivered with
instalation package of Pygame 1.7. I tried it to run from terminal. It
genaretes many:

python[342] *** _NSAutoreleaseNoPool(): Object 0x38c0e0 of class
NSCFString autoreleased with no pool in place - just leaking

I've seen this happen many, many times with downloaded pygame projects that the author had never tried on Mac OS X. It has always been solved by adding a line in the source, right after pygame is imported:

pygame.init()

The problem is that he does not have PyObjC 1.2 or later installed. He says "it's not the case", but he is definitely wrong. Importing the objc package will create an NSAutoreleasePool that will never go away. However, due to the way pygame autoinit works, it will mask out the ImportError, and instead expect you to check the status of the video subsystem yourself. The examples do not check for this condition.


Due to this confusion, pygame CVS now explicitly checks for the presence of PyObjC 1.2 or later on Mac OS X upon import, not initialization, so you WILL see the ImportError.

None of the examples exhibit any problems on Mac OS X if pygame and its dependencies are installed properly.

For some reason other platforms can get by without that, but the Mac
needs it.  This has been mentioned before.  I think Bob said that
pygame 1.7 should fix this problem, but maybe you're using 1.6?

1.7 does fix this problem, it allows each subsystem to be initialized piecemeal like the other platforms.


-bob