<table><tr><td style="">zzag created this revision.<br />zzag added a reviewer: KWin.<br />Herald added a project: KWin.<br />Herald added a subscriber: kwin.<br />zzag requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D25766">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The assertion is triggered because X11StandalongPlatform attempts to<br />
cleanup XRender resources when it's too late.</p>
<p>Even though the Platform object is a child of the Application object,<br />
we need to destroy it manually since the destructor of the QObject<br />
class starts to destroy child objects after the destructor of the<br />
QCoreApplication class has completed its execution.</p>
<p>Here is the order in which destructors run:</p>
<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">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 :(</pre></div></div></div><br /><div><strong>TEST PLAN</strong><div><ul class="remarkup-list">
<li class="remarkup-list-item">Enable maximize effect</li>
<li class="remarkup-list-item">Maximize a window</li>
<li class="remarkup-list-item">Replace the current instance of KWin/X11 with another one</li>
</ul>
<p>Without this patch, KWin/X11 crashes after the third step.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>BRANCH</strong><div><div>adjust-xrender-scene</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D25766">https://phabricator.kde.org/D25766</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>main.cpp<br />
main.h</div></div></div><br /><div><strong>To: </strong>zzag, KWin<br /><strong>Cc: </strong>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<br /></div>