From 82df10944484da51225bcbdcb0280b86490ce29c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 19 Jan 2024 14:54:54 -0500 Subject: [PATCH] gpu: Fix atlas freeing We need to unset current_atlas if we free that one. --- gsk/gpu/gskgpudevice.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gsk/gpu/gskgpudevice.c b/gsk/gpu/gskgpudevice.c index 3cce713579..7c03dfc4e2 100644 --- a/gsk/gpu/gskgpudevice.c +++ b/gsk/gpu/gskgpudevice.c @@ -147,10 +147,14 @@ static void gsk_gpu_cached_atlas_free (GskGpuDevice *device, GskGpuCached *cached) { + GskGpuDevicePrivate *priv = gsk_gpu_device_get_instance_private (device); GskGpuCachedAtlas *self = (GskGpuCachedAtlas *) cached; + if (priv->current_atlas == self) + priv->current_atlas = NULL; + g_object_unref (self->image); - + g_free (self); }