When closing the window in Windows while using Visual Studio, the sample program will crash trying to free memory that was already freed.
Cause
Order of operations was causing the crash. The OpenGL renderer was being deleted first, then the TexturedBase skin at the end of main(), since it was a local variable. The crash would then occur because the skin which depended on the freed renderer.
Fix
skin was changed to a pointer, allowing it to be deleted before the OpenGL renderer.
Misc Changes
Added a newline to the end of OpenGLSample.cpp to avoid GNU compiler warnings.
Bug
When closing the window in Windows while using Visual Studio, the sample program will crash trying to free memory that was already freed.
Cause
Order of operations was causing the crash. The OpenGL renderer was being deleted first, then the TexturedBase skin at the end of main(), since it was a local variable. The crash would then occur because the skin which depended on the freed renderer.
Fix
skin was changed to a pointer, allowing it to be deleted before the OpenGL renderer.
Misc Changes
Added a newline to the end of OpenGLSample.cpp to avoid GNU compiler warnings.