diff --git a/src/app/commands/cmd_export_sprite_sheet.cpp b/src/app/commands/cmd_export_sprite_sheet.cpp index 49a2fb9e1..ed8247f8b 100644 --- a/src/app/commands/cmd_export_sprite_sheet.cpp +++ b/src/app/commands/cmd_export_sprite_sheet.cpp @@ -1185,7 +1185,6 @@ bool ExportSpriteSheetCommand::onEnabled(Context* context) void ExportSpriteSheetCommand::onExecute(Context* context) { Site site = context->activeSite(); - Doc* document = site.document(); auto& params = this->params(); DocExporter exporter; @@ -1197,6 +1196,7 @@ void ExportSpriteSheetCommand::onExecute(Context* context) // and when the Preferences::m_docs collection is iterated to save // all DocumentPreferences, it accesses an invalid Doc* pointer (an // already removed/deleted document). + Doc* document = site.document(); DocumentPreferences& docPref(Preferences::instance().document(document)); // Show UI if the user specified it explicitly (params.ui=true) or diff --git a/src/app/script/security.cpp b/src/app/script/security.cpp index af55ec316..d9f077173 100644 --- a/src/app/script/security.cpp +++ b/src/app/script/security.cpp @@ -1,4 +1,5 @@ // Aseprite +// Copyright (C) 2019 Igara Studio S.A. // Copyright (C) 2018 David Capello // // This program is distributed under the terms of @@ -31,6 +32,7 @@ namespace app { namespace script { +#ifdef ENABLE_UI namespace { // Map from .lua file name -> sha1 @@ -65,6 +67,7 @@ std::string get_script_filename(lua_State* L) } } // anonymous namespace +#endif // ENABLE_UI int secure_io_open(lua_State* L) { diff --git a/src/app/transaction.cpp b/src/app/transaction.cpp index 1ccdae0a7..0a0983da9 100644 --- a/src/app/transaction.cpp +++ b/src/app/transaction.cpp @@ -90,7 +90,9 @@ void Transaction::commit() TX_TRACE("TX: Commit <%s>\n", m_cmds->label().c_str()); m_cmds->updateSpritePositionAfter(); +#ifdef ENABLE_UI const SpritePosition sprPos = m_cmds->spritePositionAfterExecute(); +#endif m_undo->add(m_cmds); m_cmds = nullptr;