View Full Version : Crash when destroying a DisplayWindow

09-19-2006, 07:31 PM
Well, I've been having this problem for a long while, so I thought I'd just go ahead and ask. I am using Windows and Visual Studio 2005, although it happens with Express as well and I seem to remember having the same with 2003. Maybe I am just doing something wrong, no idea.

I am using ClanLib 0.8.

Basically, I just have a class member
CL_DisplayWindow _Screen It gets initialized in an Init-method, and so it'll be destroyed when my class is freed. However, the destructor always crashes.

According to the debugger, it crashes at this line in display_window_opengl.cpp on line 225:
opengl_contexts.remove(context);. Also according to the debugger, opengl_contexts is actually empty, so that seems to be causing it although I don't see how as the context is pushed onto it at the start and does not seem to be removed anywhere.

These calls I mentioned are the only ones I do to the display component, am I just missing something or is this a bug or is it just Visual Studio being stupid??

EDIT: Argh, I just noticed the destructor actually wasn't called at the time it was supposed to.. So probably the gl and display components were destroyed before the displaywindow was or something like that.