Commit 6fb392ee authored by Jocelyn Turcotte's avatar Jocelyn Turcotte Committed by The Qt Project
Browse files

Clear callbacks with an empty value on page destruction


The current implementation offers no way to cancel async requests.
This means that normal applications could easily allow callbacks
to dereference a destroyed object unless they use a smart pointer
within the callback function object.

This patch will empty the pending callback list by calling each of
them with an empty value. This will at least allow applications to
cover the cases where the page is expected to have a shorter or equal
lifetime than objects referenced in the callback.

Change-Id: Ia9fc556b03f5d83f904a0ff4b05dc9e440ea488c
Reviewed-by: default avatarPierre Rossi <pierre.rossi@gmail.com>
Showing with 43 additions and 6 deletions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment