From c8a359d2b29b9bf0e30044b7caa4c1d6bedd5700 Mon Sep 17 00:00:00 2001 From: Lionel Date: Fri, 31 May 2024 09:29:09 +0200 Subject: [PATCH] Ensured the processing thread has exited before releasing the LZ scratch buffer --- src/Record3DStream.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Record3DStream.cpp b/src/Record3DStream.cpp index 6a7ff47..e659afb 100644 --- a/src/Record3DStream.cpp +++ b/src/Record3DStream.cpp @@ -20,6 +20,8 @@ namespace Record3D Record3DStream::~Record3DStream() { + runloopThread_.join(); + delete[] lzfseScratchBuffer_; } @@ -70,7 +72,7 @@ namespace Record3D { StreamProcessingRunloop(); } ); - runloopThread_.detach(); + return true; } @@ -240,8 +242,6 @@ namespace Record3D #endif } } - - Disconnect(); } uint8_t* Record3DStream::DecompressBuffer(const uint8_t* $compressedBuffer, size_t $compressedBufferSize, std::vector &$destinationBuffer)