From 35b2d91fb3bd8f8cc6190c041ab5f8a3ede897ba Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 10 Jun 2015 18:46:51 +0200 Subject: [PATCH] Throw error when failing to create graphics context --- components/sdlutil/sdlcursormanager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/sdlutil/sdlcursormanager.cpp b/components/sdlutil/sdlcursormanager.cpp index 1c5008f7a..a8a48f4f8 100644 --- a/components/sdlutil/sdlcursormanager.cpp +++ b/components/sdlutil/sdlcursormanager.cpp @@ -1,6 +1,7 @@ #include "sdlcursormanager.hpp" #include +#include #include #include @@ -48,6 +49,8 @@ namespace traits->pbuffer = false; _gc = osg::GraphicsContext::createGraphicsContext(traits.get()); + if (!_gc) + throw std::runtime_error("Failed to create graphics context for image decompression"); } if (_gc.valid())