Delete VFS created from assets dict before throwing error.
PiperOrigin-RevId: 853838173 Change-Id: Id0dd33b69657813275d1f42db54fae222c337791
This commit is contained in:
committed by
Copybara-Service
parent
310ac0c5ac
commit
ce74475c39
@@ -113,10 +113,10 @@ raw::MjModel* MjSpec::Compile() {
|
||||
}
|
||||
}
|
||||
auto m = mj_compile(ptr, &vfs);
|
||||
mj_deleteVFS(&vfs);
|
||||
if (!m || mjs_isWarning(ptr)) {
|
||||
throw py::value_error(mjs_getError(ptr));
|
||||
}
|
||||
mj_deleteVFS(&vfs);
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user