Clear RIDs of weight buffers when freeing to avoid double free

This commit is contained in:
clayjohn 2024-04-09 17:52:05 -07:00
parent 6c57928063
commit bafbde9f4b
1 changed files with 2 additions and 1 deletions

View File

@ -130,9 +130,10 @@ void RenderSceneBuffersRD::cleanup() {
named_textures.clear();
// Clear weight_buffer / blur textures.
for (const WeightBuffers &weight_buffer : weight_buffers) {
for (WeightBuffers &weight_buffer : weight_buffers) {
if (weight_buffer.weight.is_valid()) {
RD::get_singleton()->free(weight_buffer.weight);
weight_buffer.weight = RID();
}
}
}