Skip to content

Fix crash in WindowThumbnail::updatePaintNode()

Vlad Zahorodnii requested to merge work/zzag/fix-window-thumbnail-crash into master

Recently, the WindowThumbnail was changed so it properly discards the texture provider in the releaseResources() function.

But it appears like there's a case where the releaseResources() function can be called in the windowToTexture() function, which will result in use after free bugs.

Based on af5a855d, it looks like the WindowThumbnail item didn't use QQuickItem::releaseResources() to properly release its graphics resources. It was checking whether the texture node still has a texture. If there's no texture, it means that the texture got discarded and it needs to be re-created; otherwise it is okay to re-use the old texture.

With QQuickItem::releaseResources(), we don't need that workaround anymore since QtQuick will call the releaseResources() function whenever it wants the WindowThumbnail to discard graphics resources.

BUG: 444015

Merge request reports