From a89b42858645cc6565ea925ff020ed0881702ac6 Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Tue, 15 Oct 2013 15:30:20 +1000 Subject: [PATCH] Avoid core dump if rpc port is in use. The cleanup code needs to check for NULL rpcworkers thread group. Rebased-from: b7f6e156462a24129078252a4e957a5be622ebcc 0.8.x --- src/bitcoinrpc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 37846ffda..88df45fd5 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -852,7 +852,8 @@ void StopRPCThreads() if (rpc_io_service == NULL) return; rpc_io_service->stop(); - rpc_worker_group->join_all(); + if (rpc_worker_group != NULL) + rpc_worker_group->join_all(); delete rpc_worker_group; rpc_worker_group = NULL; delete rpc_ssl_context; rpc_ssl_context = NULL; delete rpc_io_service; rpc_io_service = NULL;