From 5fb407cffebb8ec0cc50cb3e96e1bebf79ad1bc0 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Fri, 26 Jun 2020 01:18:40 +0200 Subject: Linux/MacOSX: use standard std::shared_ptr instead of our custom implementation which is kept for compatibility with older compilers. We also introduce compatibility code for old compilers that don't define std::unique_ptr --- src/Volume/EncryptionThreadPool.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Volume') diff --git a/src/Volume/EncryptionThreadPool.cpp b/src/Volume/EncryptionThreadPool.cpp index 04c32c7d..7c86bf49 100644 --- a/src/Volume/EncryptionThreadPool.cpp +++ b/src/Volume/EncryptionThreadPool.cpp @@ -125,7 +125,9 @@ namespace VeraCrypt firstFragmentWorkItem->ItemCompletedEvent.Wait(); - unique_ptr itemException = std::move(firstFragmentWorkItem->ItemException); + unique_ptr itemException; + if (firstFragmentWorkItem->ItemException.get()) + itemException = move_ptr(firstFragmentWorkItem->ItemException); firstFragmentWorkItem->State.Set (WorkItem::State::Free); WorkItemCompletedEvent.Signal(); -- cgit v1.2.3