QtConcurrent: Fix for leak in QFuture
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>
Sun, 4 Nov 2012 19:21:31 +0000 (21:21 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 8 Nov 2012 14:11:56 +0000 (15:11 +0100)
commit17bea1689abc695d88f13cd15f73b0a59fcffdff
tree3686d3b4face64fb47fdb643a8bb73c887481101
parenta4b5cd2893a5eef09d615340ae899f785de84858
QtConcurrent: Fix for leak in QFuture

To avoid leaking when converting a QFuture<T> to a QFuture<void> we need
to have a separate ref. counter for QFuture<T>. When the last QFuture<T>
goes out of scope, we need to clean out the result data.

backported from qt/qtbase commit 731ba8ed08f80644b403556638c7f6229e678ebe
Original commit by Christian Strømme

Task-number: QTBUG-27224
Change-Id: I0c6b525cf241b5c559a1bab4e0066cd4de556ea8
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
src/corelib/concurrent/qfutureinterface.cpp
src/corelib/concurrent/qfutureinterface.h
src/corelib/concurrent/qfutureinterface_p.h
tests/auto/qfuture/tst_qfuture.cpp
tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp