Make from_file() and from_string() classmethod functions.
This prevents the user from modifying an mjSpec and then calling the functions to load it from string/file. PiperOrigin-RevId: 679311284 Change-Id: I4f1ae3cc8f15bece245f624303470d538deec410
This commit is contained in:
committed by
Copybara-Service
parent
8bbf9c7b4f
commit
6a415da267
@@ -177,8 +177,10 @@ int mjs_isWarning(mjSpec* s) {
|
||||
|
||||
// delete model
|
||||
void mj_deleteSpec(mjSpec* s) {
|
||||
mjCModel* model = static_cast<mjCModel*>(s->element);
|
||||
delete model;
|
||||
if (s) {
|
||||
mjCModel* model = static_cast<mjCModel*>(s->element);
|
||||
delete model;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user