mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-30 21:18:34 +00:00
Fix compilation when ENABLE_UI is disabled and UIContext isn't defined
This commit is contained in:
parent
693a5777e7
commit
e61888fc92
@ -380,16 +380,15 @@ namespace {
|
||||
#endif
|
||||
|
||||
struct CloseAllDocs {
|
||||
CloseAllDocs() { }
|
||||
Context* m_ctx;
|
||||
CloseAllDocs(Context* ctx) : m_ctx(ctx) { }
|
||||
~CloseAllDocs() {
|
||||
auto ctx = UIContext::instance();
|
||||
|
||||
std::vector<Doc*> docs;
|
||||
#ifdef ENABLE_UI
|
||||
for (Doc* doc : ctx->getAndRemoveAllClosedDocs())
|
||||
for (Doc* doc : static_cast<UIContext*>(m_ctx)->getAndRemoveAllClosedDocs())
|
||||
docs.push_back(doc);
|
||||
#endif
|
||||
for (Doc* doc : ctx->documents())
|
||||
for (Doc* doc : m_ctx->documents())
|
||||
docs.push_back(doc);
|
||||
for (Doc* doc : docs) {
|
||||
// First we close the document. In this way we receive recent
|
||||
@ -416,7 +415,7 @@ void App::run()
|
||||
#ifdef ENABLE_UI
|
||||
CloseMainWindow closeMainWindow(m_mainWindow);
|
||||
#endif
|
||||
CloseAllDocs closeAllDocsAtExit;
|
||||
CloseAllDocs closeAllDocsAtExit(context());
|
||||
|
||||
#ifdef ENABLE_UI
|
||||
// Run the GUI
|
||||
|
Loading…
Reference in New Issue
Block a user