Fix assert triggered for unbalanced unlock on (auto)save
ClosedPublic

Authored by kossebau on May 19 2016, 10:23 PM.

Details

Summary

KisDocument::Private::SafeSavingLocker uses a member
KisImageBarrierLockAdapter m_imageLock to do the locking of KisImage.
Which it explicitely locks and unlocks again, to keep locking in balance,
together with std::try_lock.
But KisImageBarrierLockAdapter in its deconstructor unconditionally also
calls unlock on the image, without taking into account any state of other
unlock/lock calls.
Which then triggers the Q_ASSERT(locked()); in KisImage::unlock().

BUG: 363279

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau updated this revision to Diff 3895.May 19 2016, 10:23 PM
kossebau retitled this revision from to Fix assert triggered for unbalanced unlock on (auto)save.
kossebau updated this object.
kossebau edited the test plan for this revision. (Show Details)
kossebau added reviewers: Krita, dkazakov.
dkazakov accepted this revision.May 20 2016, 6:53 AM
dkazakov edited edge metadata.

Yep, this is a really good catch! :)

This revision is now accepted and ready to land.May 20 2016, 6:53 AM
This revision was automatically updated to reflect the committed changes.