<table><tr><td style="">elvisangelaccio requested changes to this revision.<br />elvisangelaccio added a comment.<br />This revision now requires changes to proceed.
</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/D5990" rel="noreferrer">View Revision</a></tr></table><br /><div><div><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>The event handler class instance is declared volatile to decrease the chance that the linker will optimise the assignment away because the variable isn't used. Maybe wouldn't happen anyway when using new to initialise a local variable?</p></blockquote>

<p>Correct, see <a href="https://stackoverflow.com/questions/27741698/is-c-compiler-allowed-to-optimize-out-unreferenced-local-objects" class="remarkup-link" target="_blank" rel="noreferrer">https://stackoverflow.com/questions/27741698/is-c-compiler-allowed-to-optimize-out-unreferenced-local-objects</a><br />
So please remove the <tt style="background: #ebebeb; font-size: 13px;">volatile</tt>.</p>

<p>In fact, the <tt style="background: #ebebeb; font-size: 13px;">new Foo();</tt> pattern is quite common in Qt code, e.g. for dbus adaptor one would just do <tt style="background: #ebebeb; font-size: 13px;">new MyAdaptor(this);</tt>.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R36 Ark</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D5990" rel="noreferrer">https://phabricator.kde.org/D5990</a></div></div><br /><div><strong>To: </strong>rjvbb, Ark, KDE Applications, elvisangelaccio<br /><strong>Cc: </strong>elvisangelaccio, kde-utils-devel, kde-mac, tctara<br /></div>