diff --git a/programs/cli_wallet/main.cpp b/programs/cli_wallet/main.cpp index ce675bddca..a64d2d46f2 100644 --- a/programs/cli_wallet/main.cpp +++ b/programs/cli_wallet/main.cpp @@ -283,13 +283,21 @@ int main( int argc, char** argv ) fc::set_signal_handler([&wapi, &wallet_file](int signal) { ilog( "Captured SIGINT not in daemon mode" ); wapi->save_wallet_file(wallet_file.generic_string()); - std::terminate(); + #ifdef WIN32 + TerminateThread(pthread_self(), 0); + #else + pthread_cancel(pthread_self()); + #endif }, SIGINT); fc::set_signal_handler([&wapi, &wallet_file](int signal) { ilog( "Captured SIGTERM not in daemon mode" ); wapi->save_wallet_file(wallet_file.generic_string()); - std::terminate(); + #ifdef WIN32 + TerminateThread(pthread_self(), 0); + #else + pthread_cancel(pthread_self()); + #endif }, SIGTERM); wallet_cli->wait();