diff --git a/mythtv/libs/libmythui/mythmainwindow.cpp b/mythtv/libs/libmythui/mythmainwindow.cpp index e8ee60f74f6..9fa99e0f102 100644 --- a/mythtv/libs/libmythui/mythmainwindow.cpp +++ b/mythtv/libs/libmythui/mythmainwindow.cpp @@ -534,6 +534,8 @@ void MythMainWindow::ShowPainterWindow(void) { if (d->paintwin) d->paintwin->show(); + if (d->render) + d->render->Release(); } void MythMainWindow::HidePainterWindow(void) diff --git a/mythtv/libs/libmythui/mythrender_base.h b/mythtv/libs/libmythui/mythrender_base.h index 3046e958d61..2abaa31a3a0 100644 --- a/mythtv/libs/libmythui/mythrender_base.h +++ b/mythtv/libs/libmythui/mythrender_base.h @@ -51,6 +51,7 @@ class MythRender RenderType Type(void) { return m_type; } bool IsErrored(void) const { return m_errored; } QSize GetSize(void) const { return m_size; } + virtual void Release(void) { } protected: virtual ~MythRender() { } diff --git a/mythtv/libs/libmythui/mythrender_opengl.cpp b/mythtv/libs/libmythui/mythrender_opengl.cpp index 1fed46be38e..9d8f0e70b13 100644 --- a/mythtv/libs/libmythui/mythrender_opengl.cpp +++ b/mythtv/libs/libmythui/mythrender_opengl.cpp @@ -100,6 +100,12 @@ void MythRenderOpenGL::doneCurrent() m_lock->unlock(); } +void MythRenderOpenGL::Release(void) +{ + while (m_lock_level > 0) + doneCurrent(); +} + void MythRenderOpenGL::MoveResizeWindow(const QRect &rect) { QWidget *parent = (QWidget*)this->device(); diff --git a/mythtv/libs/libmythui/mythrender_opengl.h b/mythtv/libs/libmythui/mythrender_opengl.h index 6c99df64559..4161ce71d4d 100644 --- a/mythtv/libs/libmythui/mythrender_opengl.h +++ b/mythtv/libs/libmythui/mythrender_opengl.h @@ -107,6 +107,7 @@ class MUI_PUBLIC MythRenderOpenGL : public QGLContext, public MythRender virtual void makeCurrent(); virtual void doneCurrent(); + virtual void Release(void); void Init(void);