From: Gunnar Beutner Date: Tue, 14 Aug 2012 13:06:28 +0000 (+0200) Subject: Fixed crash in AsyncTask when calling GetResult() for an exception. X-Git-Tag: v0.0.1~136 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01a01704e7f716ec580aa0cfb7ff45777c404414;p=icinga2 Fixed crash in AsyncTask when calling GetResult() for an exception. --- diff --git a/base/asynctask.h b/base/asynctask.h index c3565f602..b953b854f 100644 --- a/base/asynctask.h +++ b/base/asynctask.h @@ -85,11 +85,11 @@ public: if (m_ResultRetrieved) throw_exception(runtime_error("GetResult called on an AsyncTask whose result was already retrieved.")); + m_ResultRetrieved = true; + if (m_Exception) rethrow_exception(m_Exception); - m_ResultRetrieved = true; - TResult result; std::swap(m_Result, result); return result;