mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-05 21:57:20 +00:00
Lock the document when ToolLoopImpl has to commit or rollback the change
This commit is contained in:
parent
14fed8afd5
commit
5f587af503
@ -190,7 +190,16 @@ public:
|
||||
if (!m_canceled) {
|
||||
// Paint ink
|
||||
if (getInk()->isPaint()) {
|
||||
m_expandCelCanvas.commit();
|
||||
retry_commit:;
|
||||
try {
|
||||
ContextReader reader(m_context);
|
||||
ContextWriter writer(reader);
|
||||
m_expandCelCanvas.commit();
|
||||
}
|
||||
catch (const LockedDocumentException&) {
|
||||
base::this_thread::sleep_for(0.25);
|
||||
goto retry_commit;
|
||||
}
|
||||
}
|
||||
// Selection ink
|
||||
else if (getInk()->isSelection()) {
|
||||
@ -205,7 +214,16 @@ public:
|
||||
|
||||
// If the trace was canceled or it is not a 'paint' ink...
|
||||
if (m_canceled || !getInk()->isPaint()) {
|
||||
m_expandCelCanvas.rollback();
|
||||
retry_rollback:;
|
||||
try {
|
||||
ContextReader reader(m_context);
|
||||
ContextWriter writer(reader);
|
||||
m_expandCelCanvas.rollback();
|
||||
}
|
||||
catch (const LockedDocumentException&) {
|
||||
base::this_thread::sleep_for(0.25);
|
||||
goto retry_rollback;
|
||||
}
|
||||
}
|
||||
|
||||
delete m_brush;
|
||||
|
Loading…
Reference in New Issue
Block a user