Fix crash in XRenderPictureData::~XRenderPictureData
ClosedPublic

Authored by zzag on Dec 5 2019, 5:10 PM.

Details

Summary

If the XRender scene has cross-faded a window, then, eventually, KWin/X11 will
crash in the destructor of the XRenderPictureData class during tear down with
the following message in the terminal

ASSERT: "qApp" in file /home/vlad/Workspace/KDE/src/kde/workspace/kwin/libkwineffects/kwinxrenderutils.cpp, line 163

The crash happens because X11StandalonePlatform attempts to clean up XRender
resources, including XRenderUtils::s_blendPicture, after the application object
has been destroyed.

In order to fix the crash, we have to destroy the platform object before the
destructor of QCoreApplication is executed.

Test Plan
  • Enable maximize effect
  • Maximize a window
  • Replace the current instance of KWin/X11 with another one

Without this patch, KWin/X11 crashes after the third step.

Diff Detail

Repository
R108 KWin
Branch
adjust-xrender-scene
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 19523
Build 19541: arc lint + arc unit
zzag created this revision.Dec 5 2019, 5:10 PM
Restricted Application added a project: KWin. · View Herald TranscriptDec 5 2019, 5:10 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Dec 5 2019, 5:10 PM
davidedmundson accepted this revision.Dec 12 2019, 11:56 AM
This revision is now accepted and ready to land.Dec 12 2019, 11:56 AM
This revision was automatically updated to reflect the committed changes.