diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-01-18 13:07:43 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-01-21 01:51:20 +0100 |
commit | 614847eae99bd4b6ce375f9f5572acfb3b513307 (patch) | |
tree | c32138e946654043eb47662a5140db62ab960b15 /LICENSE.QT-LICENSE-AGREEMENT | |
parent | a8794503ebdefec53a7a42479c477d04f0efa067 (diff) |
Use QPromise when creating continuations to avoid memory leaks
Continuations were using QFutureInterface to create and return the
associated future to the user. Attaching a continuation to the returned
future could cause memory leaks (described in an earlier commit). Use a
QPromise when saving the continuation, to make sure that the attached
continuation is cleaned in the destructor of the associated QPromise, so
that it doesn't keep any ref-counted copies to the shared data, thus
preventing it from being deleted.
Task-number: QTBUG-99534
Pick-to: 6.3 6.2
Change-Id: I52d5501292095d41d1e060b7dd140c8e5d01335c
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'LICENSE.QT-LICENSE-AGREEMENT')
0 files changed, 0 insertions, 0 deletions