mirror of
https://github.com/opencv/opencv.git
synced 2024-11-29 13:47:32 +08:00
Fix bug: cv::String would break if assigned to itself.
This commit is contained in:
parent
70deda354a
commit
4692d4b36e
@ -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_;
|
||||
|
Loading…
Reference in New Issue
Block a user