Commit 8bc82279 authored by David Edmundson's avatar David Edmundson
Browse files

Delete resources in XdgOutput teardown

Generated code typically cleans up resource objects when the client
calls the relevant destructor.

In multi-cast mode our wrapper can be deleted at any time, whilst a
client resource exists any existing resources that have a pending
message will then crash the compositor.

Deleting resources ahead of time also resolves this. calls to this
resource will no-op. The zxdg_output_v1::destroy_func will then be
called to delete the Resource object.
parent f834cdd9
...@@ -107,7 +107,19 @@ XdgOutputV1Interface::XdgOutputV1Interface(QObject *parent) ...@@ -107,7 +107,19 @@ XdgOutputV1Interface::XdgOutputV1Interface(QObject *parent)
} }
XdgOutputV1Interface::~XdgOutputV1Interface() XdgOutputV1Interface::~XdgOutputV1Interface()
{} {
// Generated code typically cleans up resource objects when the client calls the relevant destructor
// In multi-cast mode our wrapper can be deleted at any time whilst a client resource exists.
// any existing resources that have a pending message will then crash the compositor.
// Deleting resources ahead of time also resolves this. calls to this resource will no-op
const QMultiMap<struct ::wl_client*, QtWaylandServer::zxdg_output_v1::Resource*> resourceMap = d->resourceMap();
for (auto resource : resourceMap)
{
wl_resource_destroy(resource->handle);
}
}
void XdgOutputV1Interface::setLogicalSize(const QSize &size) void XdgOutputV1Interface::setLogicalSize(const QSize &size)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment