Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 2, 2015, 11:22:03 PM (9 years ago)
Author:
landauf
Message:

use actual types instead of 'auto'. only exception is for complicated template types, e.g. when iterating over a map

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v2/src/libraries/core/CoreStaticInitializationHandler.cc

    r10821 r10916  
    9999        std::set<Identifier*> identifiers;
    100100        const std::set<StaticallyInitializedInstance*>& instances = module->getInstances(StaticInitialization::IDENTIFIER);
    101         for (const auto & instance : instances)
     101        for (StaticallyInitializedInstance* instance : instances)
    102102            identifiers.insert(&static_cast<StaticallyInitializedIdentifier*>(instance)->getIdentifier());
    103103
     
    106106        // that objects within one module may reference each other by strong pointers. but it is not allowed that objects from another
    107107        // module (which is not unloaded) uses strong pointers to point at objects inside the unloaded module. this will lead to a crash.
    108         for (const auto & identifier : identifiers)
    109             (identifier)->destroyObjects();
     108        for (Identifier* identifier : identifiers)
     109            identifier->destroyObjects();
    110110
    111111        // check if all objects were really destroyed. this is not the case if an object is referenced by a strong pointer from another
    112112        // module (or if two objects inside this module reference each other). this will lead to a crash and must be fixed (e.g. by
    113113        // changing object dependencies; or by changing the logic that allows modules to be unloaded).
    114         for (const auto & identifier : identifiers)
     114        for (Identifier* identifier : identifiers)
    115115        {
    116116            ObjectListBase* objectList = Context::getRootContext()->getObjectList(identifier);
    117117            if (objectList->size() > 0)
    118118            {
    119                 orxout(internal_error) << "There are still " << objectList->size() << " objects of type " << (identifier)->getName()
     119                orxout(internal_error) << "There are still " << objectList->size() << " objects of type " << identifier->getName()
    120120                    << " after unloading the Identifier. This may lead to a crash" << endl;
    121121            }
     
    123123
    124124        // destroy object-lists in all contexts
    125         for (const auto & identifier : identifiers)
     125        for (Identifier* identifier : identifiers)
    126126        {
    127127            // only do this if the Identifier is not a Context itself; otherwise we delete the list we're iterating over
    128             if (!(identifier)->isExactlyA(Class(Context)))
     128            if (!identifier->isExactlyA(Class(Context)))
    129129            {
    130130                // iterate over all contexts
    131131                for (ObjectList<Context>::iterator it_context = ObjectList<Context>::begin(); it_context != ObjectList<Context>::end(); ++it_context)
    132                     it_context->destroyObjectList((identifier));
     132                    it_context->destroyObjectList(identifier);
    133133            }
    134134        }
Note: See TracChangeset for help on using the changeset viewer.