- Timestamp:
- Mar 24, 2013, 8:51:37 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/class/OrxonoxClass.cc
r9565 r9570 35 35 36 36 #include <cassert> 37 #include "core/object/MetaObjectList.h"38 #include "core/object/Context.h"39 #include "Identifier.h"40 37 41 38 namespace orxonox … … 46 43 OrxonoxClass::OrxonoxClass() 47 44 { 48 this->referenceCount_ = 0;49 this->requestedDestruction_ = false;50 45 } 51 46 … … 55 50 OrxonoxClass::~OrxonoxClass() 56 51 { 57 assert(this->referenceCount_ <= 0);58 59 // notify all destruction listeners60 for (std::set<DestructionListener*>::iterator it = this->destructionListeners_.begin(); it != this->destructionListeners_.end(); )61 (*(it++))->objectDeleted();62 }63 64 /**65 @brief Deletes the object if no @ref orxonox::SmartPtr "smart pointers" point to this object. Otherwise schedules the object to be deleted as soon as possible.66 */67 void OrxonoxClass::destroy()68 {69 assert(this); // Just in case someone tries to delete a NULL pointer70 this->requestedDestruction_ = true;71 if (this->referenceCount_ == 0)72 {73 this->preDestroy();74 if (this->referenceCount_ == 0)75 delete this;76 }77 52 } 78 53 }
Note: See TracChangeset
for help on using the changeset viewer.