From 55bee71a53f60c8c7245f2735ee33f32c5ea07e2 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Thu, 20 Jun 2024 11:12:01 +0300 Subject: [PATCH] backend/wayland: destroy ignored tablet proxies This fixes a memory leak when there are multiple tablets. --- backend/wayland/tablet_v2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/wayland/tablet_v2.c b/backend/wayland/tablet_v2.c index 53e7c914..aec67dc0 100644 --- a/backend/wayland/tablet_v2.c +++ b/backend/wayland/tablet_v2.c @@ -404,6 +404,7 @@ static void handle_pad_added(void *data, struct wlr_wl_seat *seat = data; if (seat->zwp_tablet_pad_v2 != NULL) { wlr_log(WLR_ERROR, "zwp_tablet_pad_v2 is already present"); + zwp_tablet_pad_v2_destroy(zwp_tablet_pad_v2); return; } @@ -779,6 +780,7 @@ static void handle_tool_added(void *data, struct wlr_wl_seat *seat = data; if (seat->zwp_tablet_tool_v2 != NULL) { wlr_log(WLR_ERROR, "zwp_tablet_tool_v2 already present"); + zwp_tablet_tool_v2_destroy(zwp_tablet_tool_v2); return; } @@ -860,6 +862,7 @@ static void handle_tab_added(void *data, struct wlr_wl_seat *seat = data; if (seat->zwp_tablet_v2 != NULL) { wlr_log(WLR_ERROR, "zwp_tablet_v2 already present"); + zwp_tablet_v2_destroy(zwp_tablet_v2); return; }