Hi,
I have the following code
QHash<Blub, Blab>
* firstHash
= new QHash..;
QHash<Blub, Blab>
* secondHash
= new QHash..;
..
firstHash->unite(*secondHash);
// delete secondHash;
QHash<Blub, Blab>* firstHash = new QHash..;
QHash<Blub, Blab>* secondHash = new QHash..;
..
firstHash->unite(*secondHash);
// delete secondHash;
To copy to clipboard, switch view to plain text mode
When I uncomment the delete, than my application crashes. I assume it's because all elements in the secondHash are deleted and not more available in the firstHash.
Is it save to leave the second Hash undeletet? Wouldn't that be a memory leak?
Bookmarks