-rw-r--r-- | libopie2/opiecore/osmart_pointer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opiecore/osmart_pointer.h b/libopie2/opiecore/osmart_pointer.h index a362a60..2a2518f 100644 --- a/libopie2/opiecore/osmart_pointer.h +++ b/libopie2/opiecore/osmart_pointer.h @@ -70,52 +70,52 @@ template<class T> class osmart_pointer { * this object must contain Incr(), Decr() and Shared() * methode as public members. The best way is, that it will be a child * class of RefCount */ T *ptr; public: //! standart constructor osmart_pointer() { ptr = NULL; } //! standart destructor /*! * release the reference, if it were the last reference, destroys * ptr */ ~osmart_pointer() { if (ptr){ ptr->Decr(); if (!ptr->Shared()) delete ptr; } } //! construction osmart_pointer(T* t) { if (ptr = t) ptr->Incr(); } //! Pointer copy - osmart_pointer(const smart_pointer<T>& p) + osmart_pointer(const osmart_pointer<T>& p) { if (ptr = p.ptr) ptr->Incr(); } //! pointer copy by assignment - osmart_pointer<T>& operator= (const smart_pointer<T>& p) + osmart_pointer<T>& operator= (const osmart_pointer<T>& p) { // already same: nothing to do if (ptr == p.ptr) return *this; // decouple reference if (ptr) { ptr->Decr(); if (!ptr->Shared()) delete ptr; } // establish new reference if (ptr = p.ptr) ptr->Incr(); return *this; } osmart_pointer<T>& operator= (T*p) { if (ptr==p)return *this; if (ptr) { ptr->Decr(); if (!ptr->Shared()) delete ptr; } if (ptr=p) ptr->Incr(); return *this; } //! cast to conventional pointer operator T* () const { return ptr; } //! deref: fails for NULL pointer |