Any time an object is added to the unit simulation, the unit simulation is responsible for freeing that object. This includes, units, unitGroups, and abstract maps. Maps, which are added to mapAbstractions, will be freed by the mapAbstraction. Similarly, algorithms added to searchUnits will be freed by the searchUnit when appropriate.
New code should follow the general guideline that when one object is added to another, the parent object is in charge of freeing memory for the other object upon termination. Units and unitGroups are both added to each other, but they are also both added to the unit simulation, so the simulation is responsible for deallocating both of these objects.