D25766: Fix crash in XRenderPictureData::~XRenderPictureData

Vlad Zahorodnii noreply at phabricator.kde.org
Thu Dec 5 15:43:15 GMT 2019


zzag created this revision.
zzag added a reviewer: KWin.
Herald added a project: KWin.
Herald added a subscriber: kwin.
zzag requested review of this revision.

REVISION SUMMARY
  The assertion is triggered because X11StandalongPlatform attempts to
  cleanup XRender resources when it's too late.
  
  Even though the Platform object is a child of the Application object,
  we need to destroy it manually since the destructor of the QObject
  class starts to destroy child objects after the destructor of the
  QCoreApplication class has completed its execution.
  
  Here is the order in which destructors run:
  
    ApplicationX11::~ApplicationX11()
    Application::~Application()
    QApplication::~QApplication()
    QGuiApplication::~QGuiApplication()
    QCoreApplication::~QCoreApplication() // after this qApp is nullptr
    QObject::~QObject() // attempts to destroy the Platform object
    X11StandalonePlatform::~X11StandalonePlatform() // too late :(

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.

REPOSITORY
  R108 KWin

BRANCH
  adjust-xrender-scene

REVISION DETAIL
  https://phabricator.kde.org/D25766

AFFECTED FILES
  main.cpp
  main.h

To: zzag, #kwin
Cc: kwin, LeGast00n, The-Feren-OS-Dev, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20191205/d19e5ef5/attachment.html>


More information about the kwin mailing list