<table><tr><td style="">davidedmundson 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/D4970" 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;"><blockquote style="border-left: 3px solid #a7b5bf; color: #464c5c; font-style: italic; margin: 4px 0 12px 0; padding: 4px 12px; background-color: #f8f9fc;"><p>From the the documentation of QObject::~QObject: "Warning: Deleting a QObject while pending events are waiting to be delivered can cause a crash."</p></blockquote>

<p>It can happens only if an object lives in a different thread. But the ErrorOverlay - is a widget, which should live in a main thread.</p></blockquote>

<p>That is not true.</p>

<p>If I have two things that connect to the same signal, I get two things in my event queue. Multiple things in the event queue happens all the time.<br />
If one slot deletes something another second slot implicitly relies on, I can get a crash, no threads needed.</p>

<p>In this particular case as nothing is connected to that widget it seems you're right it wont' be a problem, but not for the reason you said.</p>

<p>FWIW, QPointer is the natural replacement for QWeakPointer and it has practically no overhead.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R122 Powerdevil</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D4970" rel="noreferrer">https://phabricator.kde.org/D4970</a></div></div><br /><div><strong>To: </strong>denisshienkov, afiestas, ltoscano, volkov<br /><strong>Cc: </strong>davidedmundson, plasma-devel, volkov, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol<br /></div>