<table><tr><td style="">kossebau 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/D6625" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>The QPointer definitely is not needed here, was just result of initial approach to deal with the deletion of the QMenu.<br />
Actually the QMenu object could also be put back onto the stack, where it was initially and where it also is in some places of similar code across KDevelop codebase.<br />
Did not change that yet to make patch more simple (no "->" to "." lines). And chose QScopedPointer instead of raw pointer rather randomly.<br />
Ideally all such places should be aligned to what is considered best practice (which is what? heap or stack for QMenus?).</p>

<p>The crash was due to QMenu::exec() still being executed (and going to access class members) when the QMenu object was prematurely deleted due to sync handling of the split view actions which resulted in deletion of the parent widget set to the QMenu instance.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R33 KDevPlatform</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D6625" rel="noreferrer">https://phabricator.kde.org/D6625</a></div></div><br /><div><strong>To: </strong>kossebau, KDevelop<br /><strong>Cc: </strong>kdevelop-devel<br /></div>