aboutsummaryrefslogtreecommitdiff
path: root/src/bitcoinrpc.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-10-15 15:30:20 +1000
committerGavin Andresen <gavinandresen@gmail.com>2013-10-15 15:30:20 +1000
commitb2ba55c42b563418e7be4adb38cdbf1852e6c78d (patch)
treeeb0f59892727ebf000d03cf5f084d8c585211108 /src/bitcoinrpc.cpp
parentb9beea6e9d0f789f11d249b040e549d535bdc295 (diff)
Avoid core dump if rpc port is in use.
The cleanup code needs to check for NULL rpcworkers thread group.
Diffstat (limited to 'src/bitcoinrpc.cpp')
-rw-r--r--src/bitcoinrpc.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp
index b0df9c5e28..ae988a7608 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;