Do not delete attached specs after compilation.

Also, copy them when copying the spec.

PiperOrigin-RevId: 688998464
Change-Id: I7229fd8032eafede582194ccf73ab4160fe06768
This commit is contained in:
Alessio Quaglino
2024-10-23 09:41:07 -07:00
committed by Copybara-Service
parent e14aebfd16
commit d17d9e835c
9 changed files with 95 additions and 10 deletions
+2 -2
View File
@@ -387,11 +387,11 @@ mjSpec* ParseXML(const char* filename, const mjVFS* vfs,
return spec;
}
mjSpec* ParseSpecFromString(std::string_view xml, char* error, int nerror) {
mjSpec* ParseSpecFromString(std::string_view xml, const mjVFS* vfs, char* error, int nerror) {
RegisterResourceProvider();
std::string xml2 = {xml.begin(), xml.end()};
std::string str = "LoadModelFromString:" + xml2;
return ParseXML(str.c_str(), nullptr, error, nerror);
return ParseXML(str.c_str(), vfs, error, nerror);
}
// Main writer function - calls mjXWrite