- disabled gui for a moment
[enigma2.git] / lib / base / smartptr.h
index 85ad5a90f23e5a31238e3dcb201234d3e27e4f1c..aafecf0eacfc169e8fe8c8872c9ea138023bcad5 100644 (file)
@@ -43,21 +43,21 @@ public:
        }
        ePtr &operator=(T *c)
        {
        }
        ePtr &operator=(T *c)
        {
+               if (c)
+                       c->AddRef();
                if (ptr)
                        ptr->Release();
                ptr=c;
                if (ptr)
                        ptr->Release();
                ptr=c;
-               if (ptr)
-                       ptr->AddRef();
                return *this;
        }
        
        ePtr &operator=(ePtr<T> &c)
        {
                return *this;
        }
        
        ePtr &operator=(ePtr<T> &c)
        {
+               if (c.ptr)
+                       c.ptr->AddRef();
                if (ptr)
                        ptr->Release();
                ptr=c.ptr;
                if (ptr)
                        ptr->Release();
                ptr=c.ptr;
-               if (ptr)
-                       ptr->AddRef();
                return *this;
        }
        
                return *this;
        }