Changeset 6348 for code/branches/presentation2/src
- Timestamp:
- Dec 14, 2009, 12:50:22 AM (15 years ago)
- Location:
- code/branches/presentation2/src/libraries/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/libraries/core/OrxonoxClass.cc
r6277 r6348 78 78 this->requestedDestruction_ = true; 79 79 if (this->referenceCount_ == 0) 80 delete this; 80 { 81 this->preDestroy(); 82 if (this->referenceCount_ == 0) 83 delete this; 84 } 81 85 } 82 86 -
code/branches/presentation2/src/libraries/core/OrxonoxClass.h
r6121 r6348 135 135 { return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID); } 136 136 137 protected: 138 virtual void preDestroy() {} 139 137 140 private: 138 141 /** @brief Increments the reference counter (for smart pointers). */ … … 141 144 /** @brief Decrements the reference counter (for smart pointers). */ 142 145 inline void decrementReferenceCount() 143 { --this->referenceCount_; if (this->referenceCount_ == 0 && this->requestedDestruction_) { delete this; } } 146 { 147 --this->referenceCount_; 148 if (this->referenceCount_ == 0 && this->requestedDestruction_) 149 this->destroy(); 150 } 144 151 145 152 /** @brief Register a weak pointer which points to this object. */
Note: See TracChangeset
for help on using the changeset viewer.