fix opengl context checks

This commit is contained in:
Natsirt867
2025-12-14 08:13:43 -06:00
parent 2fe2a2644d
commit 6a4fafae4c
25 changed files with 383 additions and 46 deletions

View File

@@ -121,7 +121,20 @@ namespace OpenGL
{
if (_handle)
{
gl.deleteProgram (*_handle);
if (QOpenGLContext::currentContext() && ::gl.getCurrentContext() != nullptr)
{
gl.deleteProgram(*_handle);
}
/*else
{
GLuint id = *_handle;
gl.scheduleCleanup([id]()
{
gl.deleteProgram(id);
}
);
}*/
}
}