mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-28 15:20:15 +00:00
Catch exception if DocumentDestroyer cannot lock the document to close it
This commit is contained in:
parent
134dad8d5f
commit
073831472c
@ -304,19 +304,24 @@ bool DocumentView::onCloseView(Workspace* workspace)
|
||||
try_again = false;
|
||||
}
|
||||
|
||||
// Destroy the sprite (locking it as writer)
|
||||
DocumentDestroyer destroyer(
|
||||
static_cast<app::Context*>(m_document->context()), m_document, 250);
|
||||
try {
|
||||
// Destroy the sprite (locking it as writer)
|
||||
DocumentDestroyer destroyer(
|
||||
static_cast<app::Context*>(m_document->context()), m_document, 500);
|
||||
|
||||
StatusBar::instance()
|
||||
->setStatusText(0, "Sprite '%s' closed.",
|
||||
m_document->name().c_str());
|
||||
StatusBar::instance()
|
||||
->setStatusText(0, "Sprite '%s' closed.",
|
||||
m_document->name().c_str());
|
||||
|
||||
destroyer.destroyDocument();
|
||||
destroyer.destroyDocument();
|
||||
|
||||
// At this point the view is already destroyed
|
||||
|
||||
return true;
|
||||
// At this point the view is already destroyed
|
||||
return true;
|
||||
}
|
||||
catch (const LockedDocumentException& ex) {
|
||||
Console::showException(ex);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentView::onTabPopup(Workspace* workspace)
|
||||
|
Loading…
Reference in New Issue
Block a user