marek-simonik / record3d

Accompanying library for the Record3D iOS app (https://record3d.app/). Allows you to receive RGBD stream from iOS devices with TrueDepth camera(s).
https://record3d.app/
GNU Lesser General Public License v2.1
379 stars 55 forks source link

Ensured the processing thread has exited before releasing the LZ scratch buffer #85

Open yoyoooooooo opened 2 months ago

yoyoooooooo commented 2 months ago

In Record3DStream destructor, the preallocated buffer for LZ decompression was destroyed without waiting for the processing thread to complete, i.e. the buffer was potentially still in use. This leads to crashes on Record3DStream destructions. This has been fixed by explicitely waiting for the thread to quit before destroying the buffer. For this I had to reverse the detachment of the thread to keep it joinable, I hope I did not missed something.