SDL_Quit() crashes

Everything is going well in my program (a little asteroids game), except
when the program exits. At the end of my main() function, right after my
game loop exits, I call SDL_Quit(). There are no other threads running at
the time, and it crashes. All the time. Is there anything that can cause
this?–

  • Mik Mifflin

Everything is going well in my program (a little asteroids game), except
when the program exits. At the end of my main() function, right after my
game loop exits, I call SDL_Quit(). There are no other threads running at
the time, and it crashes. All the time. Is there anything that can cause
this?

Out of curiousity, are you using SDL for sound and running under GDB 5.x?

–ryan.

Ryan C. Gordon wrote:

Everything is going well in my program (a little asteroids game), except
when the program exits. At the end of my main() function, right after my
game loop exits, I call SDL_Quit(). There are no other threads running
at
the time, and it crashes. All the time. Is there anything that can
cause this?

Out of curiousity, are you using SDL for sound and running under GDB 5.x?

–ryan.

Nope. I’m using SDL for video and timer (calling SDL_Init with
SDL_INIT_VIDEO | SDL_INIT_TIMER).–

  • Mik Mifflin

Mik Mifflin wrote:

Everything is going well in my program (a little asteroids game), except
when the program exits. At the end of my main() function, right after my
game loop exits, I call SDL_Quit(). There are no other threads running at
the time, and it crashes. All the time. Is there anything that can cause
this?

Hmm

Are you freeing the display surface before calling SDL_Quit() ?

?lvaro

At the end of my main() function, right after my
game loop exits, I call SDL_Quit(). There are no other threads
running at the time, and it crashes. All the time. Is there
anything that can cause this?

Ryan:

Out of curiousity, are you using SDL for sound and running under GDB
5.x?

[I’m not the asteroids guy] I’m running under Windows 2k/MSVC and
using SDL 1.2.3 with SDL_mixer. FWIW, Sometimes my app hangs when I
call Mix_CloseAudio() immediately before SDL_Quit(). Like you, have no
threads running and no other objects in memory at the time. I have not
yet done a debug build of SDL mixer to figure out what is going on.

-morgan__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

Alvaro Lopes wrote:

Mik Mifflin wrote:

Everything is going well in my program (a little asteroids game), except
when the program exits. At the end of my main() function, right after my
game loop exits, I call SDL_Quit(). There are no other threads running at
the time, and it crashes. All the time. Is there anything that can cause
this?

Hmm

Are you freeing the display surface before calling SDL_Quit() ?

?lvaro

Ok, freeing the display surface (with SDL_FreeSurface() ?) before exit
sounds like a good idea, but no, this does not fix the problem, it still
crashes on exit. I can send people sources if they wanna take a look (they
are not that big).–

  • Mik Mifflin