From 85c84c1eceec697391332e6e3b9df85e03086e57 Mon Sep 17 00:00:00 2001 From: Yuval Tassa Date: Tue, 20 May 2025 12:18:14 -0700 Subject: [PATCH] Initialize Passive Viewer's internal `mjModel` and `mjData` to `nullptr`. Prevents the render thread from calling `mjv_updateScene` before these have been initialized. PiperOrigin-RevId: 761181568 Change-Id: I4f7f61fdcf7f87dcd6317883e5082d9ce2266e20 --- simulate/simulate.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simulate/simulate.h b/simulate/simulate.h index 7e20d3c5..312b5db7 100644 --- a/simulate/simulate.h +++ b/simulate/simulate.h @@ -132,8 +132,8 @@ class Simulate { // in passive mode the user owns m_ and d_, these "passive" instances are // owned by Simulate, updated from the user by the Sync() method - mjModel* m_passive_; - mjData* d_passive_; + mjModel* m_passive_ = nullptr; + mjData* d_passive_ = nullptr; std::vector user_scn_geoms_; mjOption mjopt_prev_;