Fix a macOS segfault in simulate.cc.

The segfault was caused by updating the UI outside the main thread.

PiperOrigin-RevId: 526019783
Change-Id: I3a211ce8a65f10716778bb3310bb568e00309a32
This commit is contained in:
Saran Tunyasuvunakool
2023-04-21 06:45:13 -07:00
committed by Copybara-Service
parent 0295d972cb
commit da17fdfcfd
2 changed files with 69 additions and 63 deletions
+2 -1
View File
@@ -22,6 +22,7 @@
#include <mutex>
#include <optional>
#include <ratio>
#include <string>
#include <utility>
#include <vector>
@@ -127,8 +128,8 @@ class Simulate {
int newperturb;
bool select;
mjuiState select_state;
bool full_ui_update;
bool ui_update_physics;
bool ui_update_rendering;
bool ui_update_joint;
bool ui_update_ctrl;
} pending_ = {};