Windows: When switching users while a QGLWidget is still visible then it can cause a crash when the user comes back. The reason it crashes is because the QPlatformWindow for the QGLWidget has been deleted (due to the top level one being recreated) but it has not been recreated at this point. Therefore when it goes to flush the backing store it will crash as it cannot get the HDC for the deleted QPlatformWindow.
I reproduced this using the hellogl_es2 example and doing the following:
1) Run the example
2) CTRL+ALT+DEL and select switch user
3) Just pick the same user (you don't actually need to switch, as long as the switch user is triggered)
4) The app will crash
If it does not crash, then try on a higher resolution such as 1920x1080.