[wayland] Recursively destroy WindowPixmap objects

Summary:
We need to destroy the root WindowPixmap together with all of its
children; otherwise, buffers that are attached to subsurfaces will
not be released.

Test Plan:
weston-subsurfaces doesn't quit with an error message saying that
all buffers are held by the compositor.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28145
This commit is contained in:
Vlad Zahorodnii 2020-03-19 19:25:55 +02:00
parent 348e72c56e
commit 25276d3058

View file

@ -1040,6 +1040,8 @@ WindowPixmap::WindowPixmap(const QPointer<KWayland::Server::SubSurfaceInterface>
WindowPixmap::~WindowPixmap()
{
qDeleteAll(m_children);
if (m_pixmap != XCB_WINDOW_NONE) {
xcb_free_pixmap(connection(), m_pixmap);
}