Check for assignment to self for =operator
Change-Id: If5c223e8b2f02938fa7e5d694d07f1e3f036c177
This commit is contained in:
parent
f859ee7f9b
commit
3cf78fa315
1 changed files with 3 additions and 0 deletions
|
@ -428,6 +428,9 @@ ObjectRepresentation::~ObjectRepresentation()
|
|||
|
||||
ObjectRepresentation& ObjectRepresentation::operator=( const ObjectRepresentation& rPresentation )
|
||||
{
|
||||
// Check for self-assignment
|
||||
if (this == &rPresentation)
|
||||
return *this;
|
||||
mxObject = rPresentation.mxObject;
|
||||
delete mpMtf, ( mpMtf = rPresentation.mpMtf ? new GDIMetaFile( *rPresentation.mpMtf ) : NULL );
|
||||
|
||||
|
|
Loading…
Reference in a new issue