diff options
| author | Thiago Macieira <thiago.macieira@intel.com> | 2024-12-21 11:01:43 -0300 |
|---|---|---|
| committer | Thiago Macieira <thiago.macieira@intel.com> | 2025-01-06 17:48:27 -0300 |
| commit | 357351b7ab8ab2eee865d2449ffcca9c9f502fd3 (patch) | |
| tree | 7eac20eda61fe3724e202c851e1cf8e89cf8863e /src/corelib/kernel/qobject.cpp | |
| parent | 314a5b972646a4f2ef9c1f49ddfd335f546336ab (diff) | |
Revert "Add categorized logging of delete later machinery"
This reverts commit c3a2b9f35a9a12ff3c6f5f0d11844de161b47c2a.
Unfortunately, some of the log messages happen WAY too late at process
exit time, when QtCore is unloading. In particular, the worst offender
is the one in QThreadPrivate::finish(), which is called after the last
QObject in the thread that called ::exit() was getting destroyed. This
implies we have Static (De)Initialization Order Fiascos happening (the
logging recurses into qlocale.cpp and the defaultLocalePrivate global
static has already been destroyed).
I need to revert this commit in order to fix QThreadData destruction.
The functionality is welcome back in QtCore once the fixes are in, so
long as whoever does it fixes the issues we're seeing in the CI (and I
can't reproduce on my development machine). I've created QTBUG-132429 to
track the reversal and see if the functionality can be brought back in.
Task-number: QTBUG-120124
Task-number: QTBUG-132429
Pick-to: 6.9 6.8
Change-Id: Iecf8f14529c7a2bb2185fffdfd328066098826b1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/corelib/kernel/qobject.cpp')
| -rw-r--r-- | src/corelib/kernel/qobject.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index 7c179c4bde5..2a419aabf8e 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1413,7 +1413,6 @@ bool QObject::event(QEvent *e) break; case QEvent::DeferredDelete: - qCDebug(lcDeleteLater) << "Deferred deleting" << this; delete this; break; @@ -2464,10 +2463,8 @@ void QObject::deleteLater() // as long as we're not guarding every access to the bit field. Q_D(QObject); - if (d->deleteLaterCalled) { - qCDebug(lcDeleteLater) << "Skipping deleteLater for already deferred object" << this; + if (d->deleteLaterCalled) return; - } d->deleteLaterCalled = true; @@ -2493,16 +2490,10 @@ void QObject::deleteLater() // non-conformant code path, and our best guess is that the scope level // should be 1. (Loop level 0 is special: it means that no event loops // are running.) - if (scopeLevel == 0 && loopLevel != 0) { - qCDebug(lcDeleteLater) << "Delete later called with scope level 0" - << "but loop level is > 0. Assuming scope is 1"; + if (scopeLevel == 0 && loopLevel != 0) scopeLevel = 1; - } } - qCDebug(lcDeleteLater) << "Posting deferred delete for" << this - << "with loop level" << loopLevel << "and scope level" << scopeLevel; - eventListLocker.unlock(); QCoreApplication::postEvent(this, new QDeferredDeleteEvent(loopLevel, scopeLevel)); |
