Hello,

I'm new to ClanLib and first I need to say amazing! Keep up the good work! Everything works fine until CL_SetupCore::deinit() is called. I'm using 0.8.1 version of your lib and in TicTacToe game breaks, here's backtrace:

#0 00403660 CL_OpenGLState_Generic::save(this=0x3f83b8) (opengl_state_generic.cpp:299)
#1 00414CE5 CL_OpenGLState_Generic::~CL_OpenGLState_Generic(th is=0x3f83b8) (opengl_state_generic.cpp:68)
#2 00547FCF CL_SharedPtr_Deleter<CL_OpenGLState_Generic, CL_OpenGLState_Generic>::~CL_SharedPtr_Deleter(thi s=0x3f88a8) (../../Sources/API/GL/../Core/System/sharedptr.h:58)
#3 0041F528 CL_OpenGLState::~CL_OpenGLState(this=0x3f8398) (../../Sources/API/GL/../Core/System/sharedptr.h:187)
#4 0041FFC0 CL_GLStateChecker::~CL_GLStateChecker(this=0x21800 48) (gl_state_checker.cpp:90)
#5 0041C219 CL_GraphicContext_OpenGL::~CL_GraphicContext_OpenG L(this=0x3f8150) (graphic_context_opengl.cpp:70)
#6 004349D0 CL_GraphicContext::~CL_GraphicContext(this=0x3f42f c) (graphic_context.cpp:61)
#7 004191C7 CL_DisplayWindow_OpenGL::~CL_DisplayWindow_OpenGL( this=0x3f4148) (WGL/display_window_opengl.cpp:79)
#8 0043E8CE CL_DisplayWindow_Generic::release_ref(this=0x3f414 8) (display_window_generic.cpp:65)
#9 004271C8 CL_DisplayWindow::~CL_DisplayWindow(this=0x22fe00) (display_window.cpp:90)
#10 00402065 TicTacToeApp::main(this=0x5d0020) (C:/useful/wxWidgets/samples/projekat ClanLib TicTacToe/TicTacToeApp.cpp:36)
#11 004027CE WinMain(hInstance=0x400000, hPrevInstance=0x0, lpCmdLine=0x241f2e "", nCmdShow=10) (Win32/clanapp.cpp:84)
#12 0053FBEA main() (c:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/stl_list.h:1164)

It breaks on line 299 of opengl_state_generic.cpp which is: state_texture_2d = clIsEnabled(CL_TEXTURE_2D);

Regards