Check for assignment to self for =operator

Change-Id: If5c223e8b2f02938fa7e5d694d07f1e3f036c177
This commit is contained in:
Julien Nabet 2012-06-09 01:06:57 +02:00
parent f859ee7f9b
commit 3cf78fa315

View file

@ -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 );