From 99feba0e7943b50cd6964ae06076af3757f9c7b9 Mon Sep 17 00:00:00 2001 From: Jens Nolte Date: Sat, 10 Aug 2024 03:02:10 +0200 Subject: [PATCH] Remove "Release called but is already destroyed" message --- quasar-wayland/src/Quasar/Wayland/Client/Surface.hs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/quasar-wayland/src/Quasar/Wayland/Client/Surface.hs b/quasar-wayland/src/Quasar/Wayland/Client/Surface.hs index da95f04..dcae2a2 100644 --- a/quasar-wayland/src/Quasar/Wayland/Client/Surface.hs +++ b/quasar-wayland/src/Quasar/Wayland/Client/Surface.hs @@ -110,8 +110,13 @@ releaseClientBuffer clientBuffer = do -- TODO do we need to handle the disposer future? disposeEventually_ lockDisposer traceM "ClientBuffer: released" - Released -> traceM "ClientBuffer: Duplicate release" - Destroyed -> traceM "ClientBuffer: Release called but is already destroyed" + Released -> + -- This should never happen: When a buffer is attached to multiple + -- surfaces at the same time, the release event has a race condition. + -- Therefore we only attach the buffer to once surface at at time so we + -- should never see more than one release event. + traceM "ClientBuffer released more than once" + Destroyed -> pure () destroyClientBuffer :: ClientBuffer b -> STMc NoRetry '[] () destroyClientBuffer clientBuffer = do