Fix crash on macOS when we try to save a file in a directory without privileges

This commit is contained in:
David Capello 2018-03-09 09:15:45 -03:00
parent d5cfe5123e
commit c59f03a7a0
3 changed files with 19 additions and 4 deletions

2
laf

@ -1 +1 @@
Subproject commit 7aed04b70cfb80814db5ede387746b5f09d32873
Subproject commit dbcc5745d8433fc99a2da3faffebfb04a539bae9

View File

@ -1,5 +1,5 @@
# Aseprite
# Copyright (C) 2001-2017 David Capello
# Copyright (C) 2001-2018 David Capello
######################################################################
# Compiler-specific flags
@ -37,7 +37,11 @@ endif()
# Add C++11 support only for our code (avoid Allegro)
if(UNIX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-switch -std=gnu++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-switch")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
######################################################################

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2001-2017 David Capello
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -94,6 +94,17 @@ void Job::startJob()
catch (const std::exception& ex) {
Console::showException(ex);
}
// TODO This is required by Clang to show the
// std::runtime_error() from base/file_handle.cpp library. I
// don't get this, it looks like a Clang bug, because this
// should be caught by the std::exception case.
catch (const std::runtime_error& ex) {
Console::showException(ex);
}
catch (...) {
Console console;
console.printf("Unknown error performing the task");
}
}
}
}