summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2011-03-16 01:04:12 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2011-03-16 01:04:12 (GMT)
commitf691e858f02e2b293f9674786ebd2e9cced0ff1e (patch)
tree33828b266f183212a00d103db7c4c5a6231698c0
parent785ea1b3604f44c05f0f353a5c0edba0b06592d9 (diff)
OpenGL: Avoid crashing hard if the OpenGL context is invalid.
This is a backport of 10c422a894bfc54bca00 from master.
-rw-r--r--mythtv/libs/libmythui/mythrender_opengl.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/mythtv/libs/libmythui/mythrender_opengl.cpp b/mythtv/libs/libmythui/mythrender_opengl.cpp
index a1718f1..66250c7 100644
--- a/mythtv/libs/libmythui/mythrender_opengl.cpp
+++ b/mythtv/libs/libmythui/mythrender_opengl.cpp
@@ -111,9 +111,12 @@ MythRenderOpenGL::MythRenderOpenGL(const QGLFormat& format)
MythRenderOpenGL::~MythRenderOpenGL()
{
- makeCurrent();
- DeleteOpenGLResources();
- doneCurrent();
+ if (isValid())
+ {
+ makeCurrent();
+ DeleteOpenGLResources();
+ doneCurrent();
+ }
if (m_lock)
delete m_lock;
}