Commit 44c827d7 authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fix a random crash while canceling strokes

Never store iterators to a QVector<T>::end(). They are not guaranteed to
be valid on modifying the vector.
parent 2063e169
......@@ -185,9 +185,8 @@ bool KisStroke::sanityCheckAllJobsAreCancellable() const
void KisStroke::clearQueueOnCancel()
QQueue<KisStrokeJob*>::iterator it = m_jobsQueue.begin();
QQueue<KisStrokeJob*>::iterator end = m_jobsQueue.end();
while (it != end) {
while (it != m_jobsQueue.end()) {
if ((*it)->isCancellable()) {
delete (*it);
it = m_jobsQueue.erase(it);
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