From 1281c1ed53e1ce16e17bd161d8f21f2b49cc13f4 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sat, 11 May 2024 16:56:52 +0100 Subject: [PATCH] core: avoid calling inert parents --- src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index e77a742..2fb4603 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -516,7 +516,7 @@ static const wl_interface* dummyTypes[] = { nullptr }; SOURCE += std::format(R"#( static void {}(wl_client* client, wl_resource* resource{}) {{ const auto PO = ({}*)wl_resource_get_user_data(resource); - if (PO->requests.{}) + if (PO && PO->requests.{}) PO->requests.{}(PO{}); }} )#", @@ -727,6 +727,7 @@ const wl_interface {} = {{ // it means we need to destroy it. if (wl_resource_get_user_data(pResource) == this) wl_resource_destroy(pResource); + wl_resource_set_user_data(pResource, nullptr); }} void {}::onDestroyCalled() {{