Fix bug: cv::String would break if assigned to itself.

This commit is contained in:
Roman Donchenko 2013-07-04 17:06:00 +04:00
parent 70deda354a
commit 4692d4b36e

View File

@ -580,6 +580,8 @@ String::~String()
inline
String& String::operator=(const String& str)
{
if (&str == this) return *this;
deallocate();
if (str.cstr_) CV_XADD(((int*)str.cstr_)-1, 1);
cstr_ = str.cstr_;