Fix operator= in String class.
This commit is contained in:
@ -213,9 +213,12 @@ namespace nv
|
|||||||
/// Implement value semantics.
|
/// Implement value semantics.
|
||||||
String & operator=( const String & str )
|
String & operator=( const String & str )
|
||||||
{
|
{
|
||||||
release();
|
if (str.data != data)
|
||||||
data = str.data;
|
{
|
||||||
addRef();
|
release();
|
||||||
|
data = str.data;
|
||||||
|
addRef();
|
||||||
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user