]> git.tdb.fi Git - libs/gl.git/commitdiff
Mark shaders created by materials as kept
authorMikko Rasa <tdb@tdb.fi>
Tue, 4 May 2021 21:41:22 +0000 (00:41 +0300)
committerMikko Rasa <tdb@tdb.fi>
Tue, 4 May 2021 21:41:22 +0000 (00:41 +0300)
Since they're stored in resources, it's not appropriate to delete them
outside of it.

source/materials/renderpass.cpp

index 74b734128ba5d30710aedbc12ce30f505ea8ca3c..3fbec4822607ec0f1bceec0e3bd62ca34314547b 100644 (file)
@@ -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());