Changeset 25251

Timestamp:
Apr 13, 2021, 3:47:59 PM (3 years ago)
Author:
wraitii
Message:

Destroy components in reverse order of construction.

Components have some initialisation-order dependency. They could also have destroy-order dependency, and from a RAII-like point of view, it makes sense to do this.

Differential Revision: https://code.wildfiregames.com/D3843

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/simulation2/system/ComponentManager.cpp

    r25071 r25251  
    460460    m_DynamicMessageSubscriptionsNonsyncByComponent.clear();
    461461
    462     // Delete all IComponents
    463     std::map<ComponentTypeId, std::map<entity_id_t, IComponent*> >::iterator iit = m_ComponentsByTypeId.begin();
    464     for (; iit != m_ComponentsByTypeId.end(); ++iit)
     462    // Delete all IComponents
     463    std::map<ComponentTypeId, std::map<entity_id_t, IComponent*> >::begin();
     464    for (; iit != m_ComponentsByTypeId.end(); ++iit)
    465465    {
    466466        std::map<entity_id_t, IComponent*>::iterator eit = iit->second.begin();
Note: See TracChangeset for help on using the changeset viewer.