summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2013-05-03 16:36:05 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-07 07:20:52 +0200
commit95045168470f8865263145b86597b6641b4cc035 (patch)
tree5215bceb3279cd368b9a726571ef674665e7845f /src/gui
parentcd5d1524a048355d13cf62aecbc6d2edac2e067a (diff)
Remove the crash pending warning
Even though the intentions of this warning were good, the warning was a bit harsh. In addition, in certain circumstances (like the autotest demonstrates) we could end up calling object() on an interface where the object was in the destructor. This could happen because: *after* we got the destroyed() signal, the widget would still notify the accessibility framework of a FocusOut event. Since the code even called object() from isValid(), we could not even (as a defensive measure to circumvent this issue) check the isValid() of an interface without getting this warning (duh). So - for isValid(), the warning is not needed at all, since the caller will of course check the result of isValid() and act accordingly. As for the result of object(), it should always be a pointer, but it might point to a partially destroyed object. To detect this, you simply check isValid() first: if (iface->isValid()) doStuff(iface->object()); Change-Id: I206307fe618806133d8c6bc338c412d0009d7181 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/accessible/qaccessibleobject.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/gui/accessible/qaccessibleobject.cpp b/src/gui/accessible/qaccessibleobject.cpp
index ccbfd36b70..664ff9eaf4 100644
--- a/src/gui/accessible/qaccessibleobject.cpp
+++ b/src/gui/accessible/qaccessibleobject.cpp
@@ -100,10 +100,6 @@ QAccessibleObject::~QAccessibleObject()
*/
QObject *QAccessibleObject::object() const
{
-#ifndef QT_NO_DEBUG
- if (!d->object)
- qWarning("QAccessibleInterface is invalid. Crash pending...");
-#endif
return d->object;
}