[platforms/x11] Fix valigrind warning copying window icon for windowed mode

Summary:
windowIcon.pixmap().bits() creates and deletes the QPixmap object.

Which means data is dangling when we call m_winInfo->setIcon()

Surprisingly harmless in real life.

Test Plan: Reran kwin_wayland on X11 with valigrind

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28667
This commit is contained in:
David Edmundson 2020-05-01 16:13:40 +01:00
parent bc1991706c
commit 3092043be5

View file

@ -104,7 +104,8 @@ void X11WindowedOutput::init(const QPoint &logicalPosition, const QSize &pixelSi
return;
}
NETIcon icon;
icon.data = windowIcon.pixmap(size).toImage().bits();
QImage windowImage = windowIcon.pixmap(size).toImage();
icon.data = windowImage.bits();
icon.size.width = size.width();
icon.size.height = size.height();
m_winInfo->setIcon(icon, false);