summaryrefslogtreecommitdiff
path: root/src/utils/glxhelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-25 22:31:50 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-25 23:31:02 +0300
commit7ee1d89a656c05b62fa3104b59504afed0037b69 (patch)
tree7a20e371ba1035fc43135f069407b51d81d15527 /src/utils/glxhelper.cpp
parentd49a520d19f28c613c68b574686b182a9c0621be (diff)
downloadplus-7ee1d89a656c05b62fa3104b59504afed0037b69.tar.gz
plus-7ee1d89a656c05b62fa3104b59504afed0037b69.tar.bz2
plus-7ee1d89a656c05b62fa3104b59504afed0037b69.tar.xz
plus-7ee1d89a656c05b62fa3104b59504afed0037b69.zip
Add missing checks into db directory.
Diffstat (limited to 'src/utils/glxhelper.cpp')
-rw-r--r--src/utils/glxhelper.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/utils/glxhelper.cpp b/src/utils/glxhelper.cpp
index 40f2b6f9f..42ac8ccb5 100644
--- a/src/utils/glxhelper.cpp
+++ b/src/utils/glxhelper.cpp
@@ -48,6 +48,8 @@ void *GlxHelper::createContext(const unsigned long window,
XSync(display, false);
int (*handler)(Display *, XErrorEvent *) = XSetErrorHandler(ErrorHandler);
void *context = mglXGetCurrentContext();
+ if (!display)
+ return context;
if (isGLNull(mglXGetCurrentContext)
|| isGLNull(mglXCreateContextAttribs)
|| isGLNull(mglXChooseFBConfig))
@@ -124,6 +126,8 @@ bool GlxHelper::makeCurrent(const unsigned long window,
void *const display,
void *const context)
{
+ if (!display)
+ return false;
return mglXMakeCurrent(static_cast<Display*>(display), window, context);
}