From 87be638698dbb1031e450aa6af0c973a17603a53 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 9 Mar 2024 08:13:52 +0100 Subject: [PATCH] Lock and unlock images in LayeredTileSetAtlasSource::_create_padded_image_texture. --- modules/layered_tile_map/layered_tile_set.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/layered_tile_map/layered_tile_set.cpp b/modules/layered_tile_map/layered_tile_set.cpp index 8e1b544dc..2f0e44c52 100644 --- a/modules/layered_tile_map/layered_tile_set.cpp +++ b/modules/layered_tile_map/layered_tile_set.cpp @@ -5701,6 +5701,9 @@ Ref LayeredTileSetAtlasSource::_create_padded_image_texture(const Ref image; image.instance(); image->create(size.x, size.y, false, src_image->get_format()); + + src_image->lock(); + image->lock(); for (HashMap::Element *kv = tiles.front(); kv; kv = kv->next) { for (int frame = 0; frame < (int)kv->value().animation_frames_durations.size(); frame++) { @@ -5731,6 +5734,9 @@ Ref LayeredTileSetAtlasSource::_create_padded_image_texture(const image->blit_rect(*src_image, Rect2i(src_rect.position + Vector2i(src_rect.size.x - 1, src_rect.size.y - 1), Vector2i(1, 1)), base_pos + Vector2i(src_rect.size.x, src_rect.size.y)); } } + + image->unlock(); + src_image->unlock(); Ref tex; tex.instance();