diff --git a/src/app/ui/document_view.cpp b/src/app/ui/document_view.cpp index f8fabcc60..8c8a5c836 100644 --- a/src/app/ui/document_view.cpp +++ b/src/app/ui/document_view.cpp @@ -304,19 +304,24 @@ bool DocumentView::onCloseView(Workspace* workspace) try_again = false; } - // Destroy the sprite (locking it as writer) - DocumentDestroyer destroyer( - static_cast(m_document->context()), m_document, 250); + try { + // Destroy the sprite (locking it as writer) + DocumentDestroyer destroyer( + static_cast(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)