Commit a15db2d9 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

Merge pull request #3058 from PhilLab:patch-2

parents 3334b143 efc1c393
...@@ -2625,12 +2625,15 @@ template<typename _Tp> inline Ptr<_Tp>::Ptr(const Ptr<_Tp>& _ptr) ...@@ -2625,12 +2625,15 @@ template<typename _Tp> inline Ptr<_Tp>::Ptr(const Ptr<_Tp>& _ptr)
template<typename _Tp> inline Ptr<_Tp>& Ptr<_Tp>::operator = (const Ptr<_Tp>& _ptr) template<typename _Tp> inline Ptr<_Tp>& Ptr<_Tp>::operator = (const Ptr<_Tp>& _ptr)
{ {
if (this != &_ptr)
{
int* _refcount = _ptr.refcount; int* _refcount = _ptr.refcount;
if( _refcount ) if( _refcount )
CV_XADD(_refcount, 1); CV_XADD(_refcount, 1);
release(); release();
obj = _ptr.obj; obj = _ptr.obj;
refcount = _refcount; refcount = _refcount;
}
return *this; return *this;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment