From 558a5ea3139f7d4ea55ae8fb6f4230331b98e1c3 Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Sat, 8 Apr 2023 23:10:19 +0200 Subject: [PATCH] fix(client): destroy configuration heads When a configuration head goes away (only on configuration destroy) then the object on the wire must be destroyed too. Otherwise we leak memory. --- src/client/wlr_output_configuration_v1.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client/wlr_output_configuration_v1.cpp b/src/client/wlr_output_configuration_v1.cpp index 13ab803a..dc9bf371 100644 --- a/src/client/wlr_output_configuration_v1.cpp +++ b/src/client/wlr_output_configuration_v1.cpp @@ -34,6 +34,13 @@ namespace Client { struct ConfigurationHead { + ~ConfigurationHead() + { + if (native) { + zwlr_output_configuration_head_v1_destroy(native); + } + } + WlrOutputHeadV1* head = nullptr; zwlr_output_configuration_head_v1* native = nullptr;