Ensure the staging_cairo_surface is destroyed before re-assigning it

Without doing so, memory regions allocated may not be freed in some cases.

Closes 6675.
This commit is contained in:
yangyingchao
2024-04-30 09:09:39 +08:00
parent 6f89d6759e
commit b237989bb3

View File

@@ -952,6 +952,7 @@ buffer_release_callback (void *_data,
/* Release came in, we haven't done any interim updates, so we can just use
* the old committed buffer again.
*/
g_clear_pointer (&impl->staging_cairo_surface, cairo_surface_destroy);
impl->staging_cairo_surface = g_steal_pointer (&impl->committed_cairo_surface);
}