diff options
author | Rafał Mikrut <mikrutrafal@protonmail.com> | 2021-07-31 08:52:50 +0200 |
---|---|---|
committer | Rafał Mikrut <mikrutrafal@protonmail.com> | 2021-07-31 15:30:31 +0200 |
commit | e8877806eceb7d4f5ddbe6fef4bef2f58ec3781a (patch) | |
tree | c067f3264fe3410b862a4c8025853f1fe9e57ab4 /servers/rendering/renderer_rd | |
parent | f2efa6f4f38895a4adf8efc1e4f358a8dc5779cb (diff) |
Fix 'Attempted to remove invalid ID' errors
Diffstat (limited to 'servers/rendering/renderer_rd')
-rw-r--r-- | servers/rendering/renderer_rd/renderer_compositor_rd.cpp | 2 | ||||
-rw-r--r-- | servers/rendering/renderer_rd/shader_rd.cpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/servers/rendering/renderer_rd/renderer_compositor_rd.cpp b/servers/rendering/renderer_rd/renderer_compositor_rd.cpp index a7ee0dd141..02d548bf13 100644 --- a/servers/rendering/renderer_rd/renderer_compositor_rd.cpp +++ b/servers/rendering/renderer_rd/renderer_compositor_rd.cpp @@ -222,7 +222,7 @@ void RendererCompositorRD::set_boot_image(const Ref<Image> &p_image, const Color RD::get_singleton()->swap_buffers(); - RD::get_singleton()->free(texture); + storage->free(texture); } RendererCompositorRD *RendererCompositorRD::singleton = nullptr; diff --git a/servers/rendering/renderer_rd/shader_rd.cpp b/servers/rendering/renderer_rd/shader_rd.cpp index 1b9f54d1c8..5bb12fc168 100644 --- a/servers/rendering/renderer_rd/shader_rd.cpp +++ b/servers/rendering/renderer_rd/shader_rd.cpp @@ -146,7 +146,9 @@ void ShaderRD::_clear_version(Version *p_version) { //clear versions if they exist if (p_version->variants) { for (int i = 0; i < variant_defines.size(); i++) { - RD::get_singleton()->free(p_version->variants[i]); + if (variants_enabled[i]) { + RD::get_singleton()->free(p_version->variants[i]); + } } memdelete_arr(p_version->variants); |