Skip to content

Commit

Permalink
Fixed crash on exit
Browse files Browse the repository at this point in the history
The ProjectDocument is destroyed after the DocumentManager...
  • Loading branch information
bjorn committed May 28, 2024
1 parent d0246cc commit dfa2d00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tiled/document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ Document::~Document()
if (mCurrentObjectDocument)
mCurrentObjectDocument->disconnect(this);

DocumentManager::instance()->unregisterDocument(this);
if (auto manager = DocumentManager::maybeInstance())
manager->unregisterDocument(this);
}

EditableAsset *Document::editable()
Expand Down

0 comments on commit dfa2d00

Please sign in to comment.