summaryrefslogtreecommitdiff
path: root/src/glean/dsurf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glean/dsurf.cpp')
-rw-r--r--src/glean/dsurf.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glean/dsurf.cpp b/src/glean/dsurf.cpp
index 84e4fda..8aa1e67 100644
--- a/src/glean/dsurf.cpp
+++ b/src/glean/dsurf.cpp
@@ -188,8 +188,12 @@ DrawingSurface::commonDestructorCode() {
Window::~Window() {
#if defined(__X11__)
+ if (glXGetCurrentDrawable() == xWindow)
+ glXMakeCurrent(winSys->dpy, None, NULL);
XDestroyWindow(winSys->dpy, xWindow);
#elif defined(__WIN__)
+ if (wglGetCurrentDC() == hDC)
+ wglMakeCurrent(NULL, NULL);
ReleaseDC(hWindow,hDC);
DestroyWindow(hWindow);