mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35:45 +02:00
If we release the lock first (and C++ destructor order says we do), then the return value will be constructed from data living in an unprotected container object. That data might be destroyed before we get to the copy constructor for the return value. Make a temporary copy of the return value that won't be destroyed by any other thread, then unlock the mutex, then return the copy object. Signed-off-by: Zygo Blaxell <bees@furryterror.org>