That one terminated without crashing, though I think Gl resources should be deleted before releasing the device context
Here is my termination sequence in winmain, after the message loop : (projects/OpenGLGUI/Openglview.inc)
while GetMessage @wm,0,0,0
TranslateMessage @wm
DispatchMessage @wm
wend
'
glDeleteTextures( 32, texn )
glDeleteLists drawing_list,ListCount
glDeleteLists 1000, 255 ' font
'
wglMakeCurrent hDC, NULL
wglDeleteContext hRC
ReleaseDC hWnd,hDC
#ifdef GDIplus
GdiplusShutdown token
#endif
function=wm.wparam
end function ' end of WinMain
Program objects and other resources are released after this.
Charles
PS: if you are using OpenGl declarations (not low level binding) then
FreeLibrary OpenGl
should not be used. Oxygen does this later, it its epilog code as with other DLLs.