mirror of
https://github.com/brl/mutter.git
synced 2024-12-26 04:42:14 +00:00
wayland/transaction: Don't free queue node on tear down
The GQueue node for transactions are inlined in the transaction struct,
meaning we should never let the GQueue API free the node itself, as that
actuall frees the transaction itself.
We did this during tear down if there were left-over transactions,
meaning we ended up with use-after-free issues after having popped
transactions from the queue.
Fix this by just popping the link itself, which won't attempt to free
it. It is effectively freed when freeing the transaction itself so we
won't leak any memory.
Fixes: 56260e3e07
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2805>
This commit is contained in:
parent
0e6395d932
commit
8abdbbdf24
@ -593,12 +593,18 @@ void
|
|||||||
meta_wayland_transaction_finalize (MetaWaylandCompositor *compositor)
|
meta_wayland_transaction_finalize (MetaWaylandCompositor *compositor)
|
||||||
{
|
{
|
||||||
GQueue *transactions;
|
GQueue *transactions;
|
||||||
MetaWaylandTransaction *transaction;
|
GList *node;
|
||||||
|
|
||||||
transactions = meta_wayland_compositor_get_committed_transactions (compositor);
|
transactions = meta_wayland_compositor_get_committed_transactions (compositor);
|
||||||
|
|
||||||
while ((transaction = g_queue_pop_head (transactions)))
|
while ((node = g_queue_pop_head_link (transactions)))
|
||||||
meta_wayland_transaction_free (transaction);
|
{
|
||||||
|
MetaWaylandTransaction *transaction = node->data;
|
||||||
|
|
||||||
|
g_assert (node == &transaction->node);
|
||||||
|
|
||||||
|
meta_wayland_transaction_free (transaction);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user