Doc: update the note about nested deleteLater()

If you enter a nested event loop, cause a deleteLater(), exit that event
loop, then enter a new one, the nesting count will be the same so those
are legitimate targets for deletion.

Task-number: QTBUG-73432
Change-Id: Id98140e1c2f0426cabbefffd157f975b5e291ccd
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
Thiago Macieira 2019-02-02 08:00:15 -08:00
parent 99566f6875
commit 96404f7ac8
1 changed files with 4 additions and 2 deletions

View File

@ -2171,8 +2171,10 @@ void QObject::removeEventFilter(QObject *obj)
Note that entering and leaving a new event loop (e.g., by opening a modal
dialog) will \e not perform the deferred deletion; for the object to be
deleted, the control must return to the event loop from which
deleteLater() was called.
deleted, the control must return to the event loop from which deleteLater()
was called. This does not apply to objects deleted while a previous, nested
event loop was still running: the Qt event loop will delete those objects
as soon as the new nested event loop starts.
\b{Note:} It is safe to call this function more than once; when the
first deferred deletion event is delivered, any pending events for the