From f1dd646ef5b145dbb26ddad36bb4e617845dd3b1 Mon Sep 17 00:00:00 2001 From: Sergiy Lavrynenko Date: Fri, 28 Aug 2020 08:47:22 +0300 Subject: [PATCH] SKALE-3135 fixed incorrect reset of smart pointers in main() module --- skaled/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/skaled/main.cpp b/skaled/main.cpp index 9af036350..90034bf73 100644 --- a/skaled/main.cpp +++ b/skaled/main.cpp @@ -332,7 +332,7 @@ int main( int argc, char** argv ) try { if ( !stopWasRaisedBefore ) { if ( g_jsonrpcIpcServer.get() ) { g_jsonrpcIpcServer->StopListening(); - g_jsonrpcIpcServer.release(); + g_jsonrpcIpcServer.reset( nullptr ); } if ( g_client ) { g_client->stopWorking(); @@ -2259,11 +2259,11 @@ int main( int argc, char** argv ) try { } if ( g_jsonrpcIpcServer.get() ) { g_jsonrpcIpcServer->StopListening(); - g_jsonrpcIpcServer.release(); + g_jsonrpcIpcServer.reset( nullptr ); } if ( g_client ) { g_client->stopWorking(); - g_client.release(); + g_client.reset( nullptr ); } std::cerr << localeconv()->decimal_point << std::endl; @@ -2281,25 +2281,25 @@ int main( int argc, char** argv ) try { } catch ( const Client::CreationException& ex ) { clog( VerbosityError, "main" ) << dev::nested_exception_what( ex ); // TODO close microprofile!! - g_client.release(); + g_client.reset( nullptr ); return EXIT_FAILURE; } catch ( const SkaleHost::CreationException& ex ) { clog( VerbosityError, "main" ) << dev::nested_exception_what( ex ); // TODO close microprofile!! - g_client.release(); + g_client.reset( nullptr ); return EXIT_FAILURE; } catch ( const std::exception& ex ) { clog( VerbosityError, "main" ) << "CRITICAL " << dev::nested_exception_what( ex ); clog( VerbosityError, "main" ) << "\n" << skutils::signal::generate_stack_trace() << "\n" << std::endl; - g_client.release(); + g_client.reset( nullptr ); return EXIT_FAILURE; } catch ( ... ) { clog( VerbosityError, "main" ) << "CRITICAL unknown error"; clog( VerbosityError, "main" ) << "\n" << skutils::signal::generate_stack_trace() << "\n" << std::endl; - g_client.release(); + g_client.reset( nullptr ); return EXIT_FAILURE; }