]> granicus.if.org Git - icinga2/commitdiff
Fixed crash in AsyncTask when calling GetResult() for an exception.
authorGunnar Beutner <gunnar.beutner@netways.de>
Tue, 14 Aug 2012 13:06:28 +0000 (15:06 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Tue, 14 Aug 2012 13:07:39 +0000 (15:07 +0200)
base/asynctask.h

index c3565f602e67c118e8375b0a8cb68f95b8c881aa..b953b854fb8260dafd61fbeb259e90a7b12396bc 100644 (file)
@@ -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;