mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-25 22:54:57 +02:00
Fixed crash in AsyncTask when calling GetResult() for an exception.
This commit is contained in:
parent
9ed4e78491
commit
01a01704e7
@ -85,11 +85,11 @@ public:
|
|||||||
if (m_ResultRetrieved)
|
if (m_ResultRetrieved)
|
||||||
throw_exception(runtime_error("GetResult called on an AsyncTask whose result was already retrieved."));
|
throw_exception(runtime_error("GetResult called on an AsyncTask whose result was already retrieved."));
|
||||||
|
|
||||||
|
m_ResultRetrieved = true;
|
||||||
|
|
||||||
if (m_Exception)
|
if (m_Exception)
|
||||||
rethrow_exception(m_Exception);
|
rethrow_exception(m_Exception);
|
||||||
|
|
||||||
m_ResultRetrieved = true;
|
|
||||||
|
|
||||||
TResult result;
|
TResult result;
|
||||||
std::swap(m_Result, result);
|
std::swap(m_Result, result);
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user