mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 13:21:34 +00:00
Fix crash closing/reopening sprites when "keep closed sprite data in memory" is disabled
This commit is contained in:
parent
e3f28acf9e
commit
817c6e361f
@ -98,6 +98,9 @@ void BackupObserver::onRemoveDocument(Doc* doc)
|
||||
base::remove_from_container(m_documents, doc);
|
||||
}
|
||||
if (doc->needsBackup() &&
|
||||
// If the document is already fully backed up, we don't need to
|
||||
// add it to the background thread to create its backup
|
||||
!doc->isFullyBackedUp() &&
|
||||
// If the backup is disabled, we don't need it (e.g. when the
|
||||
// document is destroyed from a script with Sprite:close(), the
|
||||
// backup is disabled)
|
||||
|
@ -81,6 +81,8 @@ void Doc::setContext(Context* ctx)
|
||||
|
||||
m_ctx = ctx;
|
||||
if (ctx) {
|
||||
DOC_TRACE("DOC: Removing as fully backed up", this);
|
||||
|
||||
// Remove the flag that indicates that this doc is fully backed
|
||||
// up, because now we are inside a context, so the user can change
|
||||
// it again and the backup will be outdated.
|
||||
@ -260,6 +262,8 @@ void Doc::setInhibitBackup(const bool inhibitBackup)
|
||||
|
||||
void Doc::markAsBackedUp()
|
||||
{
|
||||
DOC_TRACE("DOC: Mark as fully backed up", this);
|
||||
|
||||
m_flags |= kFullyBackedUp;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user