Lock and unlock images in LayeredTileSetAtlasSource::_create_padded_image_texture.

This commit is contained in:
Relintai 2024-03-09 08:13:52 +01:00
parent 068c83f71d
commit 87be638698

View File

@ -5702,6 +5702,9 @@ Ref<ImageTexture> LayeredTileSetAtlasSource::_create_padded_image_texture(const
image.instance();
image->create(size.x, size.y, false, src_image->get_format());
src_image->lock();
image->lock();
for (HashMap<Vector2i, TileAlternativesData>::Element *kv = tiles.front(); kv; kv = kv->next) {
for (int frame = 0; frame < (int)kv->value().animation_frames_durations.size(); frame++) {
// Compute the source rects.
@ -5732,6 +5735,9 @@ Ref<ImageTexture> LayeredTileSetAtlasSource::_create_padded_image_texture(const
}
}
image->unlock();
src_image->unlock();
Ref<ImageTexture> tex;
tex.instance();
tex->create_from_image(image, p_source->get_flags());