Added a call in order for each class finishes its resources once the simulation is over.
Merge remote-tracking branch 'origin/master'