Fixed cleanup method on shader classes. Fixes #1179

pull/1180/head
f4exb 2022-03-18 19:15:17 +01:00
rodzic cbdf46098d
commit 232fd689d4
6 zmienionych plików z 19 dodań i 2 usunięć

Wyświetl plik

@ -2074,6 +2074,7 @@ void GLScope::cleanup()
{
//makeCurrent();
m_glShaderSimple.cleanup();
m_glShaderColors.cleanup();
m_glShaderBottom1Scale.cleanup();
m_glShaderBottom2Scale.cleanup();
m_glShaderLeft1Scale.cleanup();

Wyświetl plik

@ -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;

Wyświetl plik

@ -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;
}
}

Wyświetl plik

@ -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;

Wyświetl plik

@ -272,6 +272,10 @@ void GLShaderTVArray::cleanup()
m_objCurrentRow = nullptr;
if (!QOpenGLContext::currentContext()) {
return;
}
if (m_objProgram)
{
delete m_objProgram;

Wyświetl plik

@ -86,6 +86,10 @@ TVScreenAnalog::~TVScreenAnalog()
void TVScreenAnalog::cleanup()
{
if (!QOpenGLContext::currentContext()) {
return;
}
if (m_shader)
{
delete m_shader;