<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://git.reviewboard.kde.org/r/122184/">https://git.reviewboard.kde.org/r/122184/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">the delete call was introduces by D. Faure, at 2ffe20e1bfe93c921c5372b4d21447b1de308d4b
with log message:</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Fix crash on exit in all QCommandLineParser-based programs.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%">Example<span style="color: #666666">:</span> kioclient5 ls <span style="color: #666666">(=</span> a syntax error<span style="color: #666666">).</span>
The issue <span style="color: #008000; font-weight: bold">is</span> that <span style="color: #666666">::</span>exit<span style="color: #666666">(1)</span> <span style="color: #008000; font-weight: bold">is</span> called<span style="color: #666666">,</span> so <span style="color: #666666">~</span>QGuiApplication isn<span style="color: #BA2121">'t called</span>
<span style="color: #BA2121">(so the style isn'</span>t deleted<span style="color: #666666">),</span> but global <span style="color: #008000; font-weight: bold">static</span> objects are deleted<span style="color: #666666">,</span>
which deletes the style<span style="color: #666666">-</span>plugin<span style="color: #666666">-</span>factory<span style="color: #666666">,</span> which unloads the style plugin<span style="color: #666666">.</span>
The crash happened because <span style="color: #BA2121">"AppEventFilter"</span> <span style="color: #008000; font-weight: bold">in</span> oxygen would still be
installed <span style="color: #008000; font-weight: bold">as</span> an app event filter<span style="color: #666666">,</span> but the plugin was unloaded<span style="color: #666666">,</span> so any
calls to it would crash<span style="color: #666666">.</span>
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">can you double-check ?
I'll add it to the review.</p></pre>
<br />
<p>- Hugo Pereira Da Costa</p>
<br />
<p>On January 21st, 2015, 3:34 p.m. UTC, David Edmundson wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
<tr>
<td>
<div>Review request for Plasma and Hugo Pereira Da Costa.</div>
<div>By David Edmundson.</div>
<p style="color: grey;"><i>Updated Jan. 21, 2015, 3:34 p.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
oxygen
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">According to the comment we need to delete the qstyle object before the
plugin if the application exits with exit(). A small test showed this is
no longer the case.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">More importantly this patch fixes a crash we see when styles were switched at
runtime and the app uses exit().</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Because Breeze has a similar delete line the first would run deleting
the style object but leaving a dangling pointer, the second would run
and crash.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Even if they only deleted their own style, both need to check the active style which means the second one is always accessing a dangling pointer.</p>
<hr style="text-rendering: inherit;margin: 0;padding: 0;white-space: normal;border: 1px solid #ddd;line-height: inherit;" />
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">A similar approach needs to go into Breeze too. I shall copy that if this gets in.</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Wrote a unit test that calls exit(0) on button press. This used to crash if we changed theme and then pressed the button. Now it no longer crashes ever.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Checked that kglobalaccel5 no longer crashes on exit after changing Breeze->Oxygen and does not crash after changing from Oxygen->Breeze</p></pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>kstyle/oxygenstyleplugin.cpp <span style="color: grey">(409ec13)</span></li>
</ul>
<p><a href="https://git.reviewboard.kde.org/r/122184/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>