Remove the warning printed when QObject's destructor catches exceptions
The warning is useless, since the application is about to terminate anyway. The user will be better informed by getting a proper backtrace of the throw point, instead of the rethrow point inside QObject's destructor. The application WILL terminate because C++11 destructors are noexcept and GCC 6 enforces it: qobject.cpp:909:13: error: throw will always call terminate() [- Werror=terminate] qobject.cpp:909:13: note: in C++11 destructors default to noexcept QT_RETHROW; ^ Change-Id: Ib056b47dde3341ef9a52ffff13ee8f01d874d224 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit is contained in:
parent
d01d08971a
commit
477721250d
@ -900,14 +900,7 @@ QObject::~QObject()
|
||||
}
|
||||
|
||||
if (!d->isWidget && d->isSignalConnected(0)) {
|
||||
QT_TRY {
|
||||
emit destroyed(this);
|
||||
} QT_CATCH(...) {
|
||||
// all the signal/slots connections are still in place - if we don't
|
||||
// quit now, we will crash pretty soon.
|
||||
qWarning("Detected an unexpected exception in ~QObject while emitting destroyed().");
|
||||
QT_RETHROW;
|
||||
}
|
||||
emit destroyed(this);
|
||||
}
|
||||
|
||||
if (d->declarativeData) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user