Skip to content

Commit c102905

Browse files
yuvaltassacopybara-github
authored andcommitted
Refactor compiler warning handling.
Compiler warnings are now accumulated in a vector of strings within the mjSpec object. New API functions `mjs_numWarnings` and `mjs_getWarning` are added to access these warnings. The compiler's log handler now chains warnings to the global log handler, ensuring they are still displayed immediately. Call sites in `mj_loadXML`, `mj_compile`, and the Python and WASM bindings have been updated to use the new warning API. PiperOrigin-RevId: 933361650 Change-Id: I4b580d1e811428085db7d8d43c36a72ca788ad5b
1 parent c8a9d47 commit c102905

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

mjpc/test/load.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ mjModel* LoadTestModel(std::string_view path) {
4242
mjModel* model = mj_loadXML(filename, nullptr, loadError, 1000);
4343
if (loadError[0]) std::cerr << "load error: " << loadError << '\n';
4444

45+
mj_freeLastXML();
4546
return model;
4647
}
4748

0 commit comments

Comments
 (0)