commit 053f27a4ffbb7cadd780c0b28507aaff98a38824
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Fri Jan 9 13:35:42 2015 +0000
PR libstdc++/60966
* include/std/future (packaged_task::operator()): Increment the
reference count on the shared state until the function returns.
@@ -1450,7 +1450,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
operator()(_ArgTypes... __args)
{
__future_base::_State_base::_S_check(_M_state);
- _M_state->_M_run(std::forward<_ArgTypes>(__args)...);
+ auto __state = _M_state;
+ __state->_M_run(std::forward<_ArgTypes>(__args)...);
}
void