diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-09-18 22:30:03 +0300 | 
|---|---|---|
| committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-09-18 22:30:39 +0300 | 
| commit | a1c215aa200840ebeed61ed7249c7f84620d9709 (patch) | |
| tree | 099bc4471a8600794ec1efe5f3ce211f80a1c91b /indra/llwindow | |
| parent | 1ce24d1b13170f1a05a39265a48e84ebc707bdba (diff) | |
SL-13733 Crash: Do not unassign event handler before handling WM_DESTROY
Diffstat (limited to 'indra/llwindow')
| -rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 21 | 
1 files changed, 14 insertions, 7 deletions
| diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 7783505c27..180954f715 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -784,9 +784,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); @@ -1133,7 +1130,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, @@ -1453,8 +1453,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, @@ -3397,7 +3401,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;   	}  } | 
