Delete VFS created from assets dict before throwing error.

PiperOrigin-RevId: 853838173
Change-Id: Id0dd33b69657813275d1f42db54fae222c337791
This commit is contained in:
Sam Haves
2026-01-08 12:13:01 -08:00
committed by Copybara-Service
parent 310ac0c5ac
commit ce74475c39
+1 -1
View File
@@ -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;
}