diff options
Diffstat (limited to 'async/src/future.cpp')
-rw-r--r-- | async/src/future.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/async/src/future.cpp b/async/src/future.cpp index ab02baf..50a326a 100644 --- a/async/src/future.cpp +++ b/async/src/future.cpp | |||
@@ -16,6 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include "future.h" | 18 | #include "future.h" |
19 | #include "async.h" | ||
19 | 20 | ||
20 | using namespace Async; | 21 | using namespace Async; |
21 | 22 | ||
@@ -31,6 +32,27 @@ FutureBase::~FutureBase() | |||
31 | { | 32 | { |
32 | } | 33 | } |
33 | 34 | ||
35 | FutureBase::PrivateBase::PrivateBase(const Private::ExecutionPtr &execution) | ||
36 | : mExecution(execution) | ||
37 | { | ||
38 | } | ||
39 | |||
40 | FutureBase::PrivateBase::~PrivateBase() | ||
41 | { | ||
42 | Private::ExecutionPtr executionPtr = mExecution.toStrongRef(); | ||
43 | if (executionPtr) { | ||
44 | executionPtr->releaseFuture(); | ||
45 | releaseExecution(); | ||
46 | } | ||
47 | } | ||
48 | |||
49 | void FutureBase::PrivateBase::releaseExecution() | ||
50 | { | ||
51 | mExecution.clear(); | ||
52 | } | ||
53 | |||
54 | |||
55 | |||
34 | FutureWatcherBase::FutureWatcherBase(QObject *parent) | 56 | FutureWatcherBase::FutureWatcherBase(QObject *parent) |
35 | : QObject(parent) | 57 | : QObject(parent) |
36 | { | 58 | { |