summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2011-03-16 00:33:22 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2011-03-16 00:33:22 (GMT)
commit10c422a894bfc54bca00a43f3811f16660ae2c3e (patch)
tree9728b77668144e420907c3b05322173594c74ad8
parentdf1df86b62bb6f87de41a65c6d8a17c9ddaae7ca (diff)
OpenGL: Avoid crashing hard if the OpenGL context is invalid.
-rw-r--r--mythtv/libs/libmythui/mythrender_opengl1.cpp2
-rw-r--r--mythtv/libs/libmythui/mythrender_opengl2.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/mythtv/libs/libmythui/mythrender_opengl1.cpp b/mythtv/libs/libmythui/mythrender_opengl1.cpp
index d0f4710..08b2cf4 100644
--- a/mythtv/libs/libmythui/mythrender_opengl1.cpp
+++ b/mythtv/libs/libmythui/mythrender_opengl1.cpp
@@ -19,6 +19,8 @@ MythRenderOpenGL1::MythRenderOpenGL1(const QGLFormat& format)
MythRenderOpenGL1::~MythRenderOpenGL1()
{
+ if (!isValid())
+ return;
makeCurrent();
DeleteOpenGLResources();
doneCurrent();
diff --git a/mythtv/libs/libmythui/mythrender_opengl2.cpp b/mythtv/libs/libmythui/mythrender_opengl2.cpp
index 47df99c..3068f45 100644
--- a/mythtv/libs/libmythui/mythrender_opengl2.cpp
+++ b/mythtv/libs/libmythui/mythrender_opengl2.cpp
@@ -150,6 +150,8 @@ MythRenderOpenGL2::MythRenderOpenGL2(const QGLFormat& format)
MythRenderOpenGL2::~MythRenderOpenGL2()
{
+ if (!isValid())
+ return;
makeCurrent();
DeleteOpenGLResources();
doneCurrent();