mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-16 05:42:32 +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(
|
Scoped destroyPasteDoc(
|
||||||
[&pasteDoc, context]{
|
[&pasteDoc, context]{
|
||||||
if (pasteDoc) {
|
if (pasteDoc) {
|
||||||
context->documents().remove(pasteDoc);
|
DocDestroyer destroyer(context, pasteDoc, 100);
|
||||||
delete pasteDoc;
|
destroyer.destroyDocument();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -97,7 +97,8 @@ void BackupObserver::onRemoveDocument(Doc* doc)
|
|||||||
std::unique_lock<std::mutex> lock(m_mutex);
|
std::unique_lock<std::mutex> lock(m_mutex);
|
||||||
base::remove_from_container(m_documents, doc);
|
base::remove_from_container(m_documents, doc);
|
||||||
}
|
}
|
||||||
if (m_config->keepEditedSpriteDataFor > 0)
|
if (m_config->keepEditedSpriteDataFor > 0 &&
|
||||||
|
doc->needsBackup())
|
||||||
m_closedDocs.push_back(doc);
|
m_closedDocs.push_back(doc);
|
||||||
else
|
else
|
||||||
m_session->removeDocument(doc);
|
m_session->removeDocument(doc);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user