From 95a07e85ccaf31a7daabfb2f34f376e75534881d Mon Sep 17 00:00:00 2001 From: Saran Tunyasuvunakool Date: Tue, 7 Feb 2023 06:33:12 -0800 Subject: [PATCH] Fix Windows stack overflow problem in the `simulate` app. PiperOrigin-RevId: 507763611 Change-Id: I199910142d9165710c48b41a842ab9aef01ff5c2 --- simulate/main.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/simulate/main.cc b/simulate/main.cc index 3e558d9d..76642774 100644 --- a/simulate/main.cc +++ b/simulate/main.cc @@ -469,7 +469,8 @@ int main(int argc, const char** argv) { scanPluginLibraries(); // simulate object encapsulates the UI - mj::Simulate sim(std::make_unique()); + auto sim = std::make_unique( + std::make_unique()); const char* filename = nullptr; if (argc > 1) { @@ -477,10 +478,10 @@ int main(int argc, const char** argv) { } // start physics thread - std::thread physicsthreadhandle = std::thread(&PhysicsThread, &sim, filename); + std::thread physicsthreadhandle(&PhysicsThread, sim.get(), filename); // start simulation UI loop (blocking call) - sim.renderloop(); + sim->renderloop(); physicsthreadhandle.join(); return 0;