Delete plugins when their corresponding objects are deleted, if their instance belonged the object.
Fixes #2061. PiperOrigin-RevId: 676402701 Change-Id: Ia4807d57a3763e2100702b7e7ec96c300d0a9cfb
This commit is contained in:
committed by
Copybara-Service
parent
f161b63a22
commit
f4381e12a2
@@ -516,6 +516,7 @@ void mjCModel::DeleteElement(mjsElement* el) {
|
||||
}
|
||||
|
||||
if (compiled) {
|
||||
ResetTreeLists(); // in case of a nested delete
|
||||
MakeLists(world);
|
||||
ProcessLists(/*checkrepeat=*/false);
|
||||
}
|
||||
@@ -586,6 +587,9 @@ void mjCModel::CopyFromSpec() {
|
||||
|
||||
// destructor
|
||||
mjCModel::~mjCModel() {
|
||||
// do not rebuild lists if we are in the process of deleting the model
|
||||
compiled = false;
|
||||
|
||||
// delete kinematic tree and all objects allocated in it
|
||||
delete bodies_[0];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user