| 1058 | |
| 1059 | protected: |
| 1060 | void set(WeakRefBase::WeakReference * ref) |
| 1061 | { |
| 1062 | if( ref == this->mReference ) |
| 1063 | return; |
| 1064 | |
| 1065 | if( this->mReference ) |
| 1066 | { |
| 1067 | // Auto-delete |
| 1068 | T* obj = this->getPointer(); |
| 1069 | if ( this->mReference->getRefCount() == 2 && obj && obj->isAutoDeleted() ) |
| 1070 | obj->deleteObject(); |
| 1071 | |
| 1072 | this->mReference->decRefCount(); |
| 1073 | } |
| 1074 | this->mReference = NULL; |
| 1075 | if( ref ) |
| 1076 | { |
| 1077 | this->mReference = ref; |
| 1078 | this->mReference->incRefCount(); |
| 1079 | } |
| 1080 | } |
| 1081 | |
| 1082 | void set(T * obj) |
| 1083 | { |
no test coverage detected