<table><tr><td style="">kkharlamov added a comment.
</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/D26764">View Revision</a></tr></table><br /><div><div><p>Okay, so, this seems not to be so simple as it appears to be. While making the variable <tt style="background: #ebebeb; font-size: 13px;">static</tt> does help with destructing it on <tt style="background: #ebebeb; font-size: 13px;">exit()</tt> call, however it causes some other crash when konsole exits. I can only guess.</p>
<p>Since fixing a crash is an urgent thing, and I don't have time right now to delve into why declaring QApplication as <tt style="background: #ebebeb; font-size: 13px;">static</tt> causes another crash, I'm okay with reverting the commit as temporary workaround. <a href="https://phabricator.kde.org/p/sandsmark/" style="
border-color: #f1f7ff;
color: #19558d;
background-color: #f1f7ff;
border: 1px solid transparent;
border-radius: 3px;
font-weight: bold;
padding: 0 4px;">@sandsmark</a> I think though, to make sure nobody gonna commit such code again, it would help to add a comment just above <tt style="background: #ebebeb; font-size: 13px;">auto app = new QApplication(argc, argv);</tt>, explaining why it's there. E.g. <tt style="background: #ebebeb; font-size: 13px;">// allocate it on the heap so we can destroy it on exit() for the KDBus workaround</tt>.</p>
<p>And then, the following comment is confusing, it was the sole reason nobody noticed anyting wrong when RAII refactor happened. All it actually says is simply "we've used <tt style="background: #ebebeb; font-size: 13px;">new</tt> to allocate the variable, so let's not forget to call <tt style="background: #ebebeb; font-size: 13px;">delete</tt>". It's better to get rid of it entirely:</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);">// Since we've allocated the QApplication on the heap for the KDBusService workaround,
// we need to delete it manually before returning from main().</pre></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R319 Konsole</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D26764">https://phabricator.kde.org/D26764</a></div></div><br /><div><strong>To: </strong>sandsmark, Konsole, hindenburg, kkharlamov<br /><strong>Cc: </strong>anthonyfieroni, konsole-devel, hindenburg, Konsole, hiangel, cent, EspadaV8, fbampaloukas, thsurrel, ngraham, maximilianocuria<br /></div>