Commit f20afb78 authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fixed a memory leak in the pooler

We can't just clear the clones stack as it stores pointers only. We
need to delete every item personally.

CCBUG:264175
parent 03521da9
......@@ -86,7 +86,11 @@ void KisTileData::releaseMemory()
m_data = 0;
}
m_clonesStack.clear();
KisTileData *clone;
while(m_clonesStack.pop(clone)) {
delete clone;
}
Q_ASSERT(m_clonesStack.isEmpty());
}
......
......@@ -53,7 +53,10 @@ inline bool KisTileData::acquire() {
* So just clean it up.
*/
if(m_usersCount == 1) {
m_clonesStack.clear();
KisTileData *clone;
while(m_clonesStack.pop(clone)) {
delete clone;
}
}
bool _ref = ref();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment