mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
Fixed cleanup method on shader classes. Fixes #1179
This commit is contained in:
parent
cbdf46098d
commit
232fd689d4
@ -2074,6 +2074,7 @@ void GLScope::cleanup()
|
||||
{
|
||||
//makeCurrent();
|
||||
m_glShaderSimple.cleanup();
|
||||
m_glShaderColors.cleanup();
|
||||
m_glShaderBottom1Scale.cleanup();
|
||||
m_glShaderBottom2Scale.cleanup();
|
||||
m_glShaderLeft1Scale.cleanup();
|
||||
|
@ -107,6 +107,10 @@ void GLShaderColors::draw(unsigned int mode, const QMatrix4x4& transformMatrix,
|
||||
|
||||
void GLShaderColors::cleanup()
|
||||
{
|
||||
if (!QOpenGLContext::currentContext()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_program)
|
||||
{
|
||||
delete m_program;
|
||||
|
@ -103,10 +103,10 @@ void GLShaderSimple::draw(unsigned int mode, const QMatrix4x4& transformMatrix,
|
||||
|
||||
void GLShaderSimple::cleanup()
|
||||
{
|
||||
if (m_program)
|
||||
if (QOpenGLContext::currentContext() && m_program)
|
||||
{
|
||||
delete m_program;
|
||||
m_program = 0;
|
||||
m_program = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -198,6 +198,10 @@ void GLShaderTextured::drawMutable(unsigned int mode, const QMatrix4x4& transfor
|
||||
|
||||
void GLShaderTextured::cleanup()
|
||||
{
|
||||
if (!QOpenGLContext::currentContext()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_program)
|
||||
{
|
||||
delete m_program;
|
||||
|
@ -272,6 +272,10 @@ void GLShaderTVArray::cleanup()
|
||||
|
||||
m_objCurrentRow = nullptr;
|
||||
|
||||
if (!QOpenGLContext::currentContext()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_objProgram)
|
||||
{
|
||||
delete m_objProgram;
|
||||
|
@ -86,6 +86,10 @@ TVScreenAnalog::~TVScreenAnalog()
|
||||
|
||||
void TVScreenAnalog::cleanup()
|
||||
{
|
||||
if (!QOpenGLContext::currentContext()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_shader)
|
||||
{
|
||||
delete m_shader;
|
||||
|
Loading…
Reference in New Issue
Block a user