Fix CompositKey self assignment.

This commit is contained in:
Felix Geyer
2012-07-17 10:47:56 +02:00
parent f767a098d6
commit 7e9343c697
2 changed files with 9 additions and 0 deletions

View File

@@ -51,6 +51,11 @@ CompositeKey* CompositeKey::clone() const
CompositeKey& CompositeKey::operator=(const CompositeKey& key)
{
// handle self assignment as that would break when calling clear()
if (this == &key) {
return *this;
}
clear();
Q_FOREACH (const Key* subKey, key.m_keys) {