I´ve discovered that with an Windows MFC application, if you use the OpenGL driver, after the user closes the view window, there is a delay of about 5 seconds before the following call returns, leaving the GUI blank and unuseable, that cannot be easily explained:-
//doccore.cpp
void CDocument::OnCloseDocument()
{
...
pFrame->DestroyWindow();
---
This calls the view and document deletedoc, etc functions, which rapidly delete the Irrlich device (in about 100 mS in debug).
However, on exiting the MFC view´s destructor class, the thread that called DestroyWindow in OnCloseDocument does not return for about 5 seconds, blocking the GUI.
This behaviour is not replicated with the D3D driver.
I´ve carefully timed and stepped through all the destruction code for the entire application, and for some reason, there is a delay in returning from the view´s destructor, to MFCs message handling code, which leaves the windows GUI blank for many seconds.
Its sort of strange because the Irrlicht device is long gone, and not other functions in the application are called, so why the problem?
