Possible Memory Leak on Mac OSX (2nd email)

G’Day,

(Sorry to repost this email - I just became a member of the list - I’ve
also updated some of the info)

We think that there may be a memory leak when you create and destroy
windows on the mac (we are using OSX 10.3.9). I’ve written this simple
test code and the memory for the process skyrockets. The memory is
constant when running the same code on a linux machine.

We have complied our test code against both SDL-1.2.8 and SDL-1.2.9.
Both exhibit
the same behaviour.

Are we doing something wrong?

#include <SDL.h>
#include <time.h>

int main() {
struct timespec sleepTime = { 1, 0 };
struct timespec rem;
for (;:wink: {
SDL_Init( SDL_INIT_VIDEO );
SDL_SetVideoMode( 600, 600, 0, SDL_OPENGL );
SDL_Quit();
/* The sleep stuff is just to allow the system monitor to get
in sync with the code
and also to give the user a chance to interupt */
nanosleep( &sleepTime, &rem );
}
}

Thanks for your help,

Robert Turnbull

We think that there may be a memory leak when you create and destroy
windows on the mac (we are using OSX 10.3.9). I’ve written this simple
test code and the memory for the process skyrockets. The memory is
constant when running the same code on a linux machine.

There was definitely a memory leak exposed by your test program. The
latest in CVS now closes this leak for 2D apps, but the SDL_OPENGL case
still leaks. I am not sure where exactly, yet, and I don’t know enough
about Objective C and Cocoa to know who is responsible for freeing what,
and if the “release” method is even the right way to do it (my other fix
guesses as such, though, and it seems to work).

Any Cocoa gurus out there want to take a shot at this?

–ryan.

Any Cocoa gurus out there want to take a shot at this?

–ryan.

So is there no one actively working on SDL who is really good with
Cocoa and Objective C?

Isn’t this a problem?On Oct 13, 2005, at 5:49 AM, Ryan C. Gordon wrote: