Skip to content

Commit

Permalink
source: set user data after checks
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed May 31, 2024
1 parent 6fdc0ce commit bd7c767
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {{
Expand Down

0 comments on commit bd7c767

Please sign in to comment.