Skip to content

Commit

Permalink
Merge pull request #13900 from daschuer/gh13885
Browse files Browse the repository at this point in the history
Fix crash in case of QEvent::ChildRemoved
  • Loading branch information
ronso0 authored Nov 18, 2024
2 parents 1f83ee3 + c904ce1 commit 60ac8ac
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions src/mixxxapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,23 +201,21 @@ bool MixxxApplication::notify(QObject* pTarget, QEvent* pEvent) {

if (m_isDeveloper &&
time.elapsed() > kEventNotifyExecTimeWarningThreshold) {
if (pEvent->type() == QEvent::DeferredDelete) {
QDebug debug = qDebug();
debug << "Processing"
<< pEvent->type()
<< "for object";
if (pEvent->type() == QEvent::DeferredDelete ||
pEvent->type() == QEvent::ChildRemoved) {
// pTarget can be already dangling in case of DeferredDelete
qDebug() << "Processing QEvent::DeferredDelete"
<< "for object"
<< static_cast<void*>(pTarget) // will print dangling address
<< "took"
<< time.elapsed().debugMillisWithUnit();
debug << static_cast<void*>(pTarget); // will print dangling address
} else {
qDebug() << "Processing"
<< pEvent->type()
<< "for object"
<< pTarget // will print address, class and object name
<< "running in thread:"
<< pTarget->thread()->objectName()
<< "took"
<< time.elapsed().debugMillisWithUnit();
debug << pTarget // will print address, class and object name
<< "running in thread:"
<< pTarget->thread()->objectName();
}
debug << "took"
<< time.elapsed().debugMillisWithUnit();
}

return ret;
Expand Down

0 comments on commit 60ac8ac

Please sign in to comment.