From 89b337424bfdf8e4698837632085d415ca41b8fc Mon Sep 17 00:00:00 2001 From: vaxerski Date: Fri, 31 May 2024 18:31:22 +0200 Subject: [PATCH] source: set user data after checks --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 7a1345b..bf423cf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -744,12 +744,12 @@ const wl_interface {} = {{ wl_list_remove(&resourceDestroyListener.link); wl_list_init(&resourceDestroyListener.link); - wl_resource_set_user_data(pResource, nullptr); - // if we still own the wayland resource, // it means we need to destroy it. - if (wl_resource_get_user_data(pResource) == this) + if (wl_resource_get_user_data(pResource) == this) {{ + wl_resource_set_user_data(pResource, nullptr); wl_resource_destroy(pResource); + }} }} void {}::onDestroyCalled() {{