summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2014-02-27 18:06:48 -0600
committerDave Parks <davep@lindenlab.com>2014-02-27 18:06:48 -0600
commit7835d48f6d6f26e37a8ff4528dc5c2faf4b8ebf7 (patch)
tree891c61ee0be7c2209f08ec99697564b60d9122f4 /indra/llwindow
parent7ad70e0f245726c98bff382539a60d591ea67aba (diff)
parenta8e22e11c5d26b3cdfa2d67919fdde8272d52ea4 (diff)
Automated merge with https://bitbucket.org/lindenlab/viewer-lion
Diffstat (limited to 'indra/llwindow')
-rwxr-xr-xindra/llwindow/llwindowwin32.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 30f5526500..767676b9b8 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();