diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-01 12:27:39 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-01 12:56:03 +0000 |
commit | 3dcde4bb979b0f7685c1ab0029aa7274cd92c904 (patch) | |
tree | 9822024ae80731f2c05cf5c129620a2ca0aba9e1 /vcl/source/opengl | |
parent | 62e5c2422cfd0e4c7f3ae3a84e9a8462db4a19dc (diff) |
return null DefaultWindow if it cannot be created
Change-Id: Id0ec9c123ca151db793380ffd7b719dbb239efa9
Diffstat (limited to 'vcl/source/opengl')
-rw-r--r-- | vcl/source/opengl/OpenGLContext.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx index 743107bcf684..d031f9c01848 100644 --- a/vcl/source/opengl/OpenGLContext.cxx +++ b/vcl/source/opengl/OpenGLContext.cxx @@ -506,10 +506,11 @@ rtl::Reference<OpenGLContext> OpenGLContext::getVCLContext(bool bMakeIfNecessary pContext = pContext->mpPrevContext; } rtl::Reference<OpenGLContext> xContext; - if( !pContext && bMakeIfNecessary ) + vcl::Window* pDefWindow = !pContext && bMakeIfNecessary ? ImplGetDefaultWindow() : nullptr; + if (pDefWindow) { // create our magic fallback window context. - xContext = ImplGetDefaultContextWindow()->GetGraphics()->GetOpenGLContext(); + xContext = pDefWindow->GetGraphics()->GetOpenGLContext(); assert(xContext.is()); } else |