mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-20 18:40:57 +00:00
Fix crash destroying temporal docs (e.g. adding new reference layer)
This commit is contained in:
parent
86ffa37fdd
commit
056eb28670
@ -121,8 +121,8 @@ void NewLayerCommand::onExecute(Context* context)
|
||||
Scoped destroyPasteDoc(
|
||||
[&pasteDoc, context]{
|
||||
if (pasteDoc) {
|
||||
context->documents().remove(pasteDoc);
|
||||
delete pasteDoc;
|
||||
DocDestroyer destroyer(context, pasteDoc, 100);
|
||||
destroyer.destroyDocument();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -97,7 +97,8 @@ void BackupObserver::onRemoveDocument(Doc* doc)
|
||||
std::unique_lock<std::mutex> lock(m_mutex);
|
||||
base::remove_from_container(m_documents, doc);
|
||||
}
|
||||
if (m_config->keepEditedSpriteDataFor > 0)
|
||||
if (m_config->keepEditedSpriteDataFor > 0 &&
|
||||
doc->needsBackup())
|
||||
m_closedDocs.push_back(doc);
|
||||
else
|
||||
m_session->removeDocument(doc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user