summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-11-13 18:22:43 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-11-13 18:22:43 +0200
commit0bba892bb0b146a2c20597d8cfe6eb0353c17f06 (patch)
tree15d3ad979533feb32114589a5fd4f79e4aa8a5ae /indra/llwindow
parentdfc406f0ff4e03e36c3d877c9bd57d2c18e08d43 (diff)
parent04c473ab46041133ea6a87dbe0d43e662472adf5 (diff)
Merge branch 'master' into DRTVWR-515-maint
# Conflicts: # indra/newview/llfloatereditextdaycycle.cpp # indra/newview/llfloaterfixedenvironment.cpp
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindowwin32.cpp47
1 files changed, 31 insertions, 16 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 7535f0deb7..a541e06c93 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -817,9 +817,6 @@ 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);
@@ -865,16 +862,24 @@ void LLWindowWin32::close()
LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL;
- // Make sure we don't leave a blank toolbar button.
- ShowWindow(mWindowHandle, SW_HIDE);
+ if (IsWindow(mWindowHandle))
+ {
+ // Make sure we don't leave a blank toolbar button.
+ ShowWindow(mWindowHandle, SW_HIDE);
- // This causes WM_DESTROY to be sent *immediately*
- if (!destroy_window_handler(mWindowHandle))
- {
- OSMessageBox(mCallbacks->translateString("MBDestroyWinFailed"),
- mCallbacks->translateString("MBShutdownErr"),
- OSMB_OK);
- }
+ // This causes WM_DESTROY to be sent *immediately*
+ if (!destroy_window_handler(mWindowHandle))
+ {
+ OSMessageBox(mCallbacks->translateString("MBDestroyWinFailed"),
+ mCallbacks->translateString("MBShutdownErr"),
+ OSMB_OK);
+ }
+ }
+ else
+ {
+ // Something killed the window while we were busy destroying gl or handle somehow got broken
+ LL_WARNS("Window") << "Failed to destroy Window, invalid handle!" << LL_ENDL;
+ }
mWindowHandle = NULL;
}
@@ -1166,7 +1171,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
<< " Height: " << (window_rect.bottom - window_rect.top)
<< " Fullscreen: " << mFullscreen
<< LL_ENDL;
- DestroyWindow(mWindowHandle);
+ if (!destroy_window_handler(mWindowHandle))
+ {
+ LL_WARNS("Window") << "Failed to properly close window before recreating it!" << LL_ENDL;
+ }
mWindowHandle = CreateWindowEx(dw_ex_style,
mWindowClassName,
mWindowTitle,
@@ -1486,8 +1494,12 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
ReleaseDC (mWindowHandle, mhDC); // Release The Device Context
mhDC = 0; // Zero The Device Context
}
- DestroyWindow (mWindowHandle); // Destroy The Window
-
+
+ // Destroy The Window
+ if (!destroy_window_handler(mWindowHandle))
+ {
+ LL_WARNS("Window") << "Failed to properly close window!" << LL_ENDL;
+ }
mWindowHandle = CreateWindowEx(dw_ex_style,
mWindowClassName,
@@ -3430,7 +3442,10 @@ void LLSplashScreenWin32::hideImpl()
{
if (mWindow)
{
- DestroyWindow(mWindow);
+ if (!destroy_window_handler(mWindow))
+ {
+ LL_WARNS("Window") << "Failed to properly close splash screen window!" << LL_ENDL;
+ }
mWindow = NULL;
}
}