- Timestamp:
- Aug 29, 2015, 5:35:59 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/CoreStaticInitializationHandler.cc
r10542 r10555 102 102 identifiers.insert(&static_cast<StaticallyInitializedIdentifier*>(*it)->getIdentifier()); 103 103 104 // destroy objects. some objects may survive this at first because they still have s martpointers pointing at them. this is105 // ok as long as those s martpointers are held by objects that are also about to be destroyed in the same loop. this means106 // that objects within one module may reference each other by s martpointers. but it is not allowed that objects from another107 // module (which is not unloaded) uses s martpointers to point at objects inside the unloaded module. this will lead to a crash.104 // destroy objects. some objects may survive this at first because they still have strong pointers pointing at them. this is 105 // ok as long as those strong pointers are held by objects that are also about to be destroyed in the same loop. this means 106 // that objects within one module may reference each other by strong pointers. but it is not allowed that objects from another 107 // module (which is not unloaded) uses strong pointers to point at objects inside the unloaded module. this will lead to a crash. 108 108 for (std::set<Identifier*>::iterator it = identifiers.begin(); it != identifiers.end(); ++it) 109 109 (*it)->destroyObjects(); 110 110 111 // check if all objects were really destroyed. this is not the case if an object is referenced by a s martpointer from another111 // check if all objects were really destroyed. this is not the case if an object is referenced by a strong pointer from another 112 112 // module (or if two objects inside this module reference each other). this will lead to a crash and must be fixed (e.g. by 113 113 // changing object dependencies; or by changing the logic that allows modules to be unloaded).
Note: See TracChangeset
for help on using the changeset viewer.