diff options
author | Dave Parks <davep@lindenlab.com> | 2014-03-11 17:42:02 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2014-03-11 17:42:02 -0500 |
commit | 02423199e89473c6aad2c6ab121d44c1f238dbd1 (patch) | |
tree | 4bb804729c65a892919ac5ae10a208c4dc0a9b1b /indra/llwindow | |
parent | cf2a180823e4e6daa0649ab54a5f7ed6ba14dbb2 (diff) | |
parent | 6abbe4cf55c2e4a6a879b00971bc5d70a7c58e8a (diff) |
Automated merge with https://bitbucket.org/lindenlab/viewer-lion
Diffstat (limited to 'indra/llwindow')
-rwxr-xr-x | indra/llwindow/llwindowwin32.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index e45a511e6d..5106da09b2 100755 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -85,6 +85,18 @@ void show_window_creation_error(const std::string& title) LL_WARNS("Window") << title << LL_ENDL; } +HGLRC SafeCreateContext(HDC hdc) +{ + __try + { + return wglCreateContext(hdc); + } + __except(EXCEPTION_EXECUTE_HANDLER) + { + return NULL; + } +} + //static BOOL LLWindowWin32::sIsClassRegistered = FALSE; @@ -1166,14 +1178,15 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO return FALSE; } - if (!(mhRC = wglCreateContext(mhDC))) + + if (!(mhRC = SafeCreateContext(mhDC))) { close(); OSMessageBox(mCallbacks->translateString("MBGLContextErr"), mCallbacks->translateString("MBError"), OSMB_OK); return FALSE; } - + if (!wglMakeCurrent(mhDC, mhRC)) { close(); |