File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -319,15 +319,23 @@ class MeshLoadersApp final : public MonoWindowApplication, public BuiltinResourc
319319 if (geometries.empty ())
320320 return false ;
321321
322- // TODO: do it async
323322 if (m_saveGeom)
323+ {
324+ if (m_saveGeomTaskFuture.valid ())
325+ {
326+ m_logger->log (" Waiting for previous geometry saving task to complete..." , ILogger::ELL_INFO);
327+ m_saveGeomTaskFuture.wait ();
328+ }
329+
330+ std::string currentGeomSavePath = m_specifiedGeomSavePath.value_or ((m_saveGeomPrefixPath / path (m_modelPath).filename ()).generic_string ());
324331 m_saveGeomTaskFuture = std::async (
325332 std::launch::async,
326- [this , geometries] { writeGeometry (
333+ [this , geometries, currentGeomSavePath ] { writeGeometry (
327334 geometries[0 ],
328- m_specifiedGeomSavePath. value_or ((m_saveGeomPrefixPath / path (m_modelPath). filename ()). generic_string ())
335+ currentGeomSavePath
329336 ); }
330337 );
338+ }
331339
332340 using aabb_t = hlsl::shapes::AABB<3 ,double >;
333341 auto printAABB = [&](const aabb_t & aabb, const char * extraMsg=" " )->void
You can’t perform that action at this time.
0 commit comments