Check for self-assignment in operator=
This commit is contained in:
@@ -477,10 +477,13 @@ wxMask::wxMask(const wxMask &mask)
|
||||
}
|
||||
|
||||
wxMask& wxMask::operator=(const wxMask &mask)
|
||||
{
|
||||
if (this != &mask)
|
||||
{
|
||||
delete m_qtBitmap;
|
||||
QBitmap *mask_bmp = mask.GetHandle();
|
||||
m_qtBitmap = mask_bmp ? new QBitmap(*mask_bmp) : NULL;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@@ -350,11 +350,13 @@ wxRegionIterator::~wxRegionIterator()
|
||||
}
|
||||
|
||||
wxRegionIterator& wxRegionIterator::operator=(const wxRegionIterator& ri)
|
||||
{
|
||||
if (this != &ri)
|
||||
{
|
||||
delete m_qtRects;
|
||||
|
||||
m_qtRects = new QVector< QRect >( *ri.m_qtRects );
|
||||
m_pos = ri.m_pos;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user