summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorAndreyL ProductEngine <alihatskiy@productengine.com>2018-09-27 13:04:12 +0300
committerAndreyL ProductEngine <alihatskiy@productengine.com>2018-09-27 13:04:12 +0300
commit892d3a9bf870bd4af802a8cd742130649c627cf2 (patch)
treecf13c94a613e0c567fbe0ed7ad0e075b4c3877bd /indra/llwindow
parent3f970601339fa34937454fd83820ffb1c7d6b295 (diff)
parent58aef8beaf79dc83546a7b080014ca5030733ac8 (diff)
Merged in lindenlab/viewer-release
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindowwin32.cpp31
1 files changed, 21 insertions, 10 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index f98c2423e5..4ee4a5357c 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -752,9 +752,6 @@ void LLWindowWin32::close()
mDragDrop->reset();
- // Make sure cursor is visible and we haven't mangled the clipping state.
- setMouseClipping(FALSE);
- showCursor();
// Go back to screen mode written in the registry.
if (mFullscreen)
@@ -762,9 +759,23 @@ void LLWindowWin32::close()
resetDisplayResolution();
}
+ // Don't process events in our mainWindowProc any longer.
+ SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, NULL);
+
+ // Make sure cursor is visible and we haven't mangled the clipping state.
+ showCursor();
+ setMouseClipping(FALSE);
+ if (gKeyboard)
+ {
+ gKeyboard->resetKeys();
+ }
+
// Clean up remaining GL state
- LL_DEBUGS("Window") << "Shutting down GL" << LL_ENDL;
- gGLManager.shutdownGL();
+ if (gGLManager.mInited)
+ {
+ LL_INFOS("Window") << "Cleaning up GL" << LL_ENDL;
+ gGLManager.shutdownGL();
+ }
LL_DEBUGS("Window") << "Releasing Context" << LL_ENDL;
if (mhRC)
@@ -785,16 +796,16 @@ void LLWindowWin32::close()
// Restore gamma to the system values.
restoreGamma();
- if (mhDC && !ReleaseDC(mWindowHandle, mhDC))
+ if (mhDC)
{
- LL_WARNS("Window") << "Release of ghDC failed" << LL_ENDL;
+ if (!ReleaseDC(mWindowHandle, mhDC))
+ {
+ LL_WARNS("Window") << "Release of ghDC failed" << LL_ENDL;
+ }
mhDC = NULL;
}
LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL;
-
- // Don't process events in our mainWindowProc any longer.
- SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, NULL);
// Make sure we don't leave a blank toolbar button.
ShowWindow(mWindowHandle, SW_HIDE);