diff --git a/programs/cli_wallet/main.cpp b/programs/cli_wallet/main.cpp index 269ddfdf8f..88c027a20e 100644 --- a/programs/cli_wallet/main.cpp +++ b/programs/cli_wallet/main.cpp @@ -280,16 +280,14 @@ int main( int argc, char** argv ) wallet_cli->register_api( wapi ); wallet_cli->start(); - fc::set_signal_handler([&wallet_cli, &wapi, &wallet_file](int signal) { + fc::set_signal_handler([](int signal) { ilog( "Captured SIGINT not in daemon mode" ); - wapi->save_wallet_file(wallet_file.generic_string()); - wallet_cli->quit_blocked_thread(); + fclose(stdin); }, SIGINT); - fc::set_signal_handler([&wallet_cli, &wapi, &wallet_file](int signal) { + fc::set_signal_handler([](int signal) { ilog( "Captured SIGTERM not in daemon mode" ); - wapi->save_wallet_file(wallet_file.generic_string()); - wallet_cli->quit_blocked_thread(); + fclose(stdin); }, SIGTERM); wallet_cli->wait();