Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed crash, if wrong or no render context was present in destructor

  • Loading branch information...
commit ed0e9413e8704f4185cf30c5df5a0a2ad473c34c 1 parent 851559f
gerhard authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 cvd_src/Win32/glwindow.cpp
View
5 cvd_src/Win32/glwindow.cpp
@@ -215,8 +215,9 @@ void GLWindow::init(const ImageRef& size, int bpp, const std::string& title, con
GLWindow::~GLWindow()
{
if(state->hRC){
- if (!wglMakeCurrent(NULL,NULL))
- throw Exceptions::GLWindow::RuntimeError("Release of DC and RC failed.");
+ if (wglGetCurrentContext() == state->hRC)
+ if (!wglMakeCurrent(NULL,NULL))
+ throw Exceptions::GLWindow::RuntimeError("Release of DC and RC failed.");
if (!wglDeleteContext(state->hRC))
throw Exceptions::GLWindow::RuntimeError("Release Rendering Context failed.");
}
Please sign in to comment.
Something went wrong with that request. Please try again.