Skip to content

Commit

Permalink
WaylandResource: Fix deleting resource
Browse files Browse the repository at this point in the history
`delete this` doesn't work on non-virtual base classes. Derp.

Probably impacts #1520
  • Loading branch information
misyltoad committed Sep 19, 2024
1 parent 4be5215 commit ddf0d76
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/WaylandServer/WaylandResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,6 @@ namespace gamescope::WaylandServer
{
}

void OnResourceDestroy()
{
m_pResource = nullptr;
m_pClient = nullptr;
m_uVersion = 0;

delete this;
}

template <typename T>
static bool CheckAllocation( const T &object, wl_client *pClient )
{
Expand Down Expand Up @@ -101,7 +92,7 @@ namespace gamescope::WaylandServer
[]( wl_resource *pResource )
{
T *pObject = CWaylandResource::FromWlResource<T>( pResource );
pObject->OnResourceDestroy();
delete pObject;
});

return pThing;
Expand Down

0 comments on commit ddf0d76

Please sign in to comment.