Allow passing a null pointer in mj_recompile.

Fixes #1819.

PiperOrigin-RevId: 653242587
Change-Id: I36dbd6ed54abdf21abeb62cf41ee88f159008d01
This commit is contained in:
Alessio Quaglino
2024-07-17 08:28:13 -07:00
committed by Copybara-Service
parent a2fd34caee
commit 2664cc1391
4 changed files with 38 additions and 24 deletions
+4 -1
View File
@@ -863,8 +863,11 @@ TEST_F(MujocoTest, PreserveState) {
EXPECT_EQ(data->act[i], d_expected->act[i]) << i;
}
// destroy everything
// check that the function is callable with no data
mj_deleteData(data);
mj_recompile(spec, 0, model, nullptr);
// destroy everything
mj_deleteData(d_expected);
mj_deleteSpec(spec);
mj_deleteModel(model);