From 17955723c325f486e9cae0c3e318e81bce202aee Mon Sep 17 00:00:00 2001 From: Relintai Date: Sun, 12 Dec 2021 18:00:56 +0100 Subject: [PATCH] lock and unlock the image properly. --- rtile_set.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rtile_set.cpp b/rtile_set.cpp index ae576bb..436df58 100644 --- a/rtile_set.cpp +++ b/rtile_set.cpp @@ -4539,6 +4539,7 @@ void RTileSetAtlasSource::_update_padded_texture() { Ref image; image.instance(); image->create(size.x, size.y, false, Image::FORMAT_RGBA8); + image->lock(); for (const Map::Element *kv = tiles.front(); kv; kv = kv->next()) { for (int frame = 0; frame < (int)kv->value().animation_frames_durations.size(); frame++) { @@ -4568,6 +4569,8 @@ void RTileSetAtlasSource::_update_padded_texture() { } } + image->unlock(); + if (!padded_texture.is_valid()) { padded_texture.instance(); }