Change LoadModelFromString to return a smart pointer, add MakeData, and update tests to have C++ RAII clean up model and data.

PiperOrigin-RevId: 935980153
Change-Id: I41d25bfab4935494dc984168820cb7cad123cadf
This commit is contained in:
Kyle Bayes
2026-06-22 04:18:29 -07:00
committed by Copybara-Service
parent 34d142ee50
commit 1490336955
39 changed files with 4616 additions and 5908 deletions
+1 -2
View File
@@ -120,8 +120,7 @@ void BM_CompileManyTextures(benchmark::State& state) {
for (auto s : state) {
char error[1024];
mjModel* model = LoadModelFromString(xml, error, sizeof(error));
mj_deleteModel(model);
MjModelPtr model = LoadModelFromString(xml, error, sizeof(error));
}
// Reset cache capacity to default value.