Fix Windows stack overflow problem in the simulate app.
PiperOrigin-RevId: 507763611 Change-Id: I199910142d9165710c48b41a842ab9aef01ff5c2
This commit is contained in:
committed by
Copybara-Service
parent
dd632b7ccc
commit
95a07e85cc
+4
-3
@@ -469,7 +469,8 @@ int main(int argc, const char** argv) {
|
|||||||
scanPluginLibraries();
|
scanPluginLibraries();
|
||||||
|
|
||||||
// simulate object encapsulates the UI
|
// simulate object encapsulates the UI
|
||||||
mj::Simulate sim(std::make_unique<mj::GlfwAdapter>());
|
auto sim = std::make_unique<mj::Simulate>(
|
||||||
|
std::make_unique<mj::GlfwAdapter>());
|
||||||
|
|
||||||
const char* filename = nullptr;
|
const char* filename = nullptr;
|
||||||
if (argc > 1) {
|
if (argc > 1) {
|
||||||
@@ -477,10 +478,10 @@ int main(int argc, const char** argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// start physics thread
|
// start physics thread
|
||||||
std::thread physicsthreadhandle = std::thread(&PhysicsThread, &sim, filename);
|
std::thread physicsthreadhandle(&PhysicsThread, sim.get(), filename);
|
||||||
|
|
||||||
// start simulation UI loop (blocking call)
|
// start simulation UI loop (blocking call)
|
||||||
sim.renderloop();
|
sim->renderloop();
|
||||||
physicsthreadhandle.join();
|
physicsthreadhandle.join();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user