Commit 3092043b authored by David Edmundson's avatar David Edmundson

[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
parent bc199170
......@@ -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);
......
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