Compare commits

...

1 Commits

Author SHA1 Message Date
Michael Catanzaro
b5b55c0b0b gpu: fix memory corruption in cache_gc_cb()
gsk_gpu_device_gc() may release the last ref on the GskGpuDevice,
leading to memory corruption when setting priv->cache_gc_source = 0.

Fixes #6861
2024-07-14 14:02:51 -05:00

View File

@@ -65,12 +65,16 @@ cache_gc_cb (gpointer data)
timestamp = g_get_monotonic_time ();
GSK_DEBUG (CACHE, "Periodic GC (timestamp %lld)", (long long) timestamp);
g_object_ref (self);
if (gsk_gpu_device_gc (self, timestamp))
{
priv->cache_gc_source = 0;
g_object_unref (self);
return G_SOURCE_REMOVE;
}
g_object_unref (self);
return G_SOURCE_CONTINUE;
}