From da0bcaf6469311f03ba35d48a4a405c95594a686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Sat, 7 Feb 2015 17:45:18 +0100 Subject: Async: mark our future as finished after returning from error handler Error handlers don't have access to the future, so they can't mark it as finished, so we do it after the error handler is run. This ensures that FutureWatchers will finish. --- async/src/async.h | 1 + 1 file changed, 1 insertion(+) (limited to 'async/src') diff --git a/async/src/async.h b/async/src/async.h index a2a11ac..753a44f 100644 --- a/async/src/async.h +++ b/async/src/async.h @@ -342,6 +342,7 @@ void ThenExecutor::previousFutureReady() if (this->mPrevFuture && this->mPrevFuture->errorCode()) { if (this->mErrorFunc) { this->mErrorFunc(this->mPrevFuture->errorCode(), this->mPrevFuture->errorMessage()); + this->mResult->setFinished(); } else { static_cast*>(this->mResult)->setError(this->mPrevFuture->errorCode(), this->mPrevFuture->errorMessage()); //propagate error if no error handler is available -- cgit v1.2.3