Fix crash on ending ar session with async ar recorder
This commit is contained in:
@@ -53,6 +53,7 @@ namespace OpenVulkano::AR
|
||||
ArRecorder::~ArRecorder()
|
||||
{
|
||||
if (!m_settings.asyncRecording) WriteMetadataFile();
|
||||
else m_asyncProcessor.Close();
|
||||
}
|
||||
|
||||
void ArRecorder::WriteColorImage(ArFrame* arFrame, MultiPartArchiveWriter* colorWriter, const std::filesystem::path* path, bool highRes) const
|
||||
@@ -191,7 +192,7 @@ namespace OpenVulkano::AR
|
||||
{
|
||||
for(MultiPartArchiveWriter* writer : { m_colorWriter.get(), m_depthWriter.get(), m_confidenceWriter.get(), m_metadataWriter.get(), m_highResWriter.get() })
|
||||
{
|
||||
writer->Split();
|
||||
if (writer) writer->Split();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,6 +283,12 @@ namespace OpenVulkano::AR
|
||||
|
||||
ArRecorder::AsyncProcessor::~AsyncProcessor()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
void ArRecorder::AsyncProcessor::Close()
|
||||
{
|
||||
if (requestExit) return;
|
||||
requestExit = true;
|
||||
newDataAvailable.notify_one();
|
||||
if (std::this_thread::get_id() != processingThread.get_id())
|
||||
|
||||
Reference in New Issue
Block a user