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
This commit is contained in:
Gavin Andresen 2013-10-15 15:30:20 +10:00 committed by Warren Togami
parent dc4cd268f5
commit a89b428586

View File

@ -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;