diff options
author | Jan Arve Saether <jan-arve.saether@digia.com> | 2013-05-03 16:36:05 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-07 07:20:52 +0200 |
commit | 95045168470f8865263145b86597b6641b4cc035 (patch) | |
tree | 5215bceb3279cd368b9a726571ef674665e7845f /LICENSE.PREVIEW.COMMERCIAL | |
parent | cd5d1524a048355d13cf62aecbc6d2edac2e067a (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 'LICENSE.PREVIEW.COMMERCIAL')
0 files changed, 0 insertions, 0 deletions