gz-sim icon indicating copy to clipboard operation
gz-sim copied to clipboard

Unload model plugins when the model is removed from the world

Open diegoferigo opened this issue 4 years ago • 2 comments

As discussed in https://github.com/ignitionrobotics/ign-gazebo/issues/39#issuecomment-613957221, model plugins are not unloaded when the model is removed from the world.

There are few problems that this behaviour could cause:

  1. Memory leak. If the simulation is very long and models are inserted and deleted multiple times, the RAM consumption slowly increases. (e.g. https://github.com/ignitionrobotics/ign-gazebo/issues/47)
  2. If the plugin access ECM components of the model and it does not handle properly the case when they are not found (because the model has been removed), the behaviour could be undefined.

In #39 the problem was acknowledged but no specific issue was opened to track it.

diegoferigo avatar Apr 29 '20 18:04 diegoferigo