From: Mikko Rasa Date: Tue, 4 May 2021 21:41:22 +0000 (+0300) Subject: Mark shaders created by materials as kept X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=commitdiff_plain;h=66636f876635ee283594c15a7dbd47d5bb639366 Mark shaders created by materials as kept Since they're stored in resources, it's not appropriate to delete them outside of it. --- diff --git a/source/materials/renderpass.cpp b/source/materials/renderpass.cpp index 74b73412..3fbec482 100644 --- a/source/materials/renderpass.cpp +++ b/source/materials/renderpass.cpp @@ -43,6 +43,7 @@ void RenderPass::maybe_create_material_shader() extra_spec["use_shadow_map"] = true; shprog = material->create_compatible_shader(extra_spec); + shprog.keep(); if(shdata) shdata = new ProgramData(*shdata, shprog.get());