SDL_Quit crashes

When I call SDL_Quit at the end of my program, it crashes. What could be
a reason for SDL_Quit to crash?

Here is what gdb says:

Program received signal SIGSEGV, Segmentation fault.
0x2ac3b112 in free () from /lib/libc.so.6
(gdb) where
#0 0x2ac3b112 in free () from /lib/libc.so.6
#1 0x2ad8eeb8 in DTOR_END () from /usr/X11R6/lib/libX11.so.6
#2 0x2acf781d in XCloseDisplay () from /usr/X11R6/lib/libX11.so.6
#3 0x2aaf75b5 in X11_VideoQuit (this=0x8099368) at SDL_x11video.c:755
#4 0x2aaf337f in SDL_VideoQuit () at SDL_video.c:771
#5 0x2aac7dee in SDL_Quit () at SDL.c:127
#6 0x804ca00 in main () at freemicro.cc:361

Thanks, Karl.

When I call SDL_Quit at the end of my program, it crashes. What could be
a reason for SDL_Quit to crash?

A crash in free() usually indicates memory corruption (array bounds
overwrites, etc.)

Check your code for memory problems.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec