From b2ba55c42b563418e7be4adb38cdbf1852e6c78d 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. --- src/bitcoinrpc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index b0df9c5e..ae988a76 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -881,7 +881,8 @@ void StopRPCThreads() deadlineTimers.clear(); 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;