From 9e2e1050bb41c1d1be709c8f293bd38a4212a8b6 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 10 Oct 2020 18:26:29 +1000 Subject: [PATCH] GL/Program: Don't delete nonexistant shaders (when using binaries) --- src/common/gl/program.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/gl/program.cpp b/src/common/gl/program.cpp index 39618b117..c6e99c71c 100644 --- a/src/common/gl/program.cpp +++ b/src/common/gl/program.cpp @@ -199,9 +199,11 @@ bool Program::Link() { glLinkProgram(m_program_id); - glDeleteShader(m_vertex_shader_id); + if (m_vertex_shader_id != 0) + glDeleteShader(m_vertex_shader_id); m_vertex_shader_id = 0; - glDeleteShader(m_fragment_shader_id); + if (m_fragment_shader_id != 0) + glDeleteShader(m_fragment_shader_id); m_fragment_shader_id = 0; GLint status = GL_FALSE;