From 062ce664caf7729588a21e65cc471ca05c3976fb Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sat, 25 Jul 2020 20:17:47 +0300 Subject: [PATCH] Unlock the image before getting its size in generate_gradient() This *may* solve a rare crash related to memory. --- src/Autoload/DrawingAlgos.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Autoload/DrawingAlgos.gd b/src/Autoload/DrawingAlgos.gd index 995189958..172a4e77f 100644 --- a/src/Autoload/DrawingAlgos.gd +++ b/src/Autoload/DrawingAlgos.gd @@ -499,10 +499,11 @@ func generate_gradient(image : Image, colors : Array, steps := 2, direction : in color = colors[-1].linear_interpolate(colors[0], t * i) colors.insert(1, color) - image.lock() + image.unlock() if direction == GradientDirection.BOTTOM or direction == GradientDirection.RIGHT: colors.invert() var size := image.get_size() + image.lock() var gradient_size if direction == GradientDirection.TOP or direction == GradientDirection.BOTTOM: