update iOS project
This commit is contained in:
@@ -520,6 +520,7 @@ void App::async_update()
|
||||
void App::async_redraw()
|
||||
{
|
||||
redraw = true;
|
||||
ui_cv.notify_all();
|
||||
}
|
||||
|
||||
void App::async_end()
|
||||
|
||||
@@ -34,7 +34,6 @@ NodeMessageBox* App::message_box(const std::string &title, const std::string& te
|
||||
m->btn_ok->m_text->set_text("Ok");
|
||||
if (!cancel_button)
|
||||
m->btn_cancel->destroy();
|
||||
layout[main_id]->update();
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
@@ -540,7 +540,6 @@ void App::init_menu_file()
|
||||
else
|
||||
{
|
||||
Image img;
|
||||
async_start();
|
||||
img.load_file(path);
|
||||
if (img.width == img.height / 6 || img.width == img.height * 2)
|
||||
{
|
||||
@@ -554,7 +553,6 @@ void App::init_menu_file()
|
||||
Canvas::set_mode(kCanvasMode::Import);
|
||||
}
|
||||
async_redraw();
|
||||
async_end();
|
||||
}
|
||||
});
|
||||
popup->mouse_release();
|
||||
|
||||
@@ -1448,6 +1448,7 @@ void Canvas::FloodData::apply()
|
||||
layer->m_dirty_face[plane] = true;
|
||||
layer->m_dirty_box[plane] = box_union(layer->m_dirty_box[plane], bb[plane]);
|
||||
}
|
||||
Canvas::I->m_unsaved = true;
|
||||
}
|
||||
|
||||
void Canvas::resize(int width, int height)
|
||||
|
||||
@@ -41,14 +41,9 @@
|
||||
|
||||
std::string base_address;
|
||||
std::atomic_flag handler_executed;
|
||||
void exception_handler(NSException *exception)
|
||||
|
||||
void save_recovery()
|
||||
{
|
||||
if (handler_executed.test_and_set())
|
||||
exit(0);
|
||||
LOG("exception %s\n", [[exception name] cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
NSString* callstack = [[NSThread callStackSymbols] componentsJoinedByString:@"\n"];
|
||||
LOG("base:\n%s\ncallstack:\n%s", base_address.c_str(), [callstack cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
|
||||
auto t = std::time(nullptr);
|
||||
auto tm = *std::localtime(&t);
|
||||
std::ostringstream oss;
|
||||
@@ -57,6 +52,16 @@ void exception_handler(NSException *exception)
|
||||
|
||||
if (App::I->canvas && App::I->canvas->m_canvas)
|
||||
App::I->canvas->m_canvas->project_save_thread(path);
|
||||
}
|
||||
|
||||
void exception_handler(NSException *exception)
|
||||
{
|
||||
if (handler_executed.test_and_set())
|
||||
exit(0);
|
||||
LOG("exception %s\n", [[exception name] cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
NSString* callstack = [[NSThread callStackSymbols] componentsJoinedByString:@"\n"];
|
||||
LOG("base:\n%s\ncallstack:\n%s", base_address.c_str(), [callstack cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
save_recovery();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -66,15 +71,19 @@ static void signal_handler (int signo) {
|
||||
LOG("signal %d\n", signo);
|
||||
NSString* callstack = [[NSThread callStackSymbols] componentsJoinedByString:@"\n"];
|
||||
LOG("base:\n%s\ncallstack:\n%s", base_address.c_str(), [callstack cStringUsingEncoding:NSUTF8StringEncoding]);
|
||||
save_recovery();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
auto t = std::time(nullptr);
|
||||
auto tm = *std::localtime(&t);
|
||||
std::ostringstream oss;
|
||||
oss << std::put_time(&tm, "%d-%m-%Y %H-%M-%S");
|
||||
auto path = App::I->data_path + "/" + App::I->doc_name + "-recovery (" + oss.str() + ").ppi";
|
||||
void SignalHandler(int sig, siginfo_t *info, void *context)
|
||||
{
|
||||
save_recovery();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (App::I->canvas && App::I->canvas->m_canvas)
|
||||
App::I->canvas->m_canvas->project_save_thread(path);
|
||||
void TerminateHandler()
|
||||
{
|
||||
save_recovery();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -89,4 +98,27 @@ void install_global_handlers()
|
||||
signal(SIGFPE, signal_handler);
|
||||
signal(SIGBUS, signal_handler);
|
||||
signal(SIGPIPE, signal_handler);
|
||||
|
||||
/*
|
||||
struct sigaction mySigAction;
|
||||
mySigAction.sa_sigaction = SignalHandler;
|
||||
mySigAction.sa_flags = SA_SIGINFO;
|
||||
|
||||
sigemptyset(&mySigAction.sa_mask);
|
||||
sigaction(SIGQUIT, &mySigAction, NULL);
|
||||
sigaction(SIGILL, &mySigAction, NULL);
|
||||
sigaction(SIGTRAP, &mySigAction, NULL);
|
||||
sigaction(SIGABRT, &mySigAction, NULL);
|
||||
sigaction(SIGEMT, &mySigAction, NULL);
|
||||
sigaction(SIGFPE, &mySigAction, NULL);
|
||||
sigaction(SIGBUS, &mySigAction, NULL);
|
||||
sigaction(SIGSEGV, &mySigAction, NULL);
|
||||
sigaction(SIGSYS, &mySigAction, NULL);
|
||||
sigaction(SIGPIPE, &mySigAction, NULL);
|
||||
sigaction(SIGALRM, &mySigAction, NULL);
|
||||
sigaction(SIGXCPU, &mySigAction, NULL);
|
||||
sigaction(SIGXFSZ, &mySigAction, NULL);
|
||||
|
||||
std::set_terminate(TerminateHandler);
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user