Permalink
Browse files

OpenGL: Avoid crashing hard if the OpenGL context is invalid.

  • Loading branch information...
1 parent df1df86 commit 10c422a894bfc54bca00a43f3811f16660ae2c3e Mark Kendall committed Mar 16, 2011
Showing with 4 additions and 0 deletions.
  1. +2 −0 mythtv/libs/libmythui/mythrender_opengl1.cpp
  2. +2 −0 mythtv/libs/libmythui/mythrender_opengl2.cpp
@@ -19,6 +19,8 @@ MythRenderOpenGL1::MythRenderOpenGL1(const QGLFormat& format)
MythRenderOpenGL1::~MythRenderOpenGL1()
{
+ if (!isValid())
+ return;
makeCurrent();
DeleteOpenGLResources();
doneCurrent();
@@ -150,6 +150,8 @@ MythRenderOpenGL2::MythRenderOpenGL2(const QGLFormat& format)
MythRenderOpenGL2::~MythRenderOpenGL2()
{
+ if (!isValid())
+ return;
makeCurrent();
DeleteOpenGLResources();
doneCurrent();

0 comments on commit 10c422a

Please sign in to comment.