* Shutdown is split into 2 parts: * Part 1: shut down everything but the main wallet instance (done in PrepareShutdown() ) * Part 2: delete wallet instance * * In case of a restart PrepareShutdown() was already called before, but this method here gets * called implicitly when the parent object is deleted. In this case we have to skip the * PrepareShutdown() part because it was already executed and
| 290 | * PrepareShutdown() part because it was already executed and just delete the wallet instance. |
| 291 | */ |
| 292 | void Shutdown() |
| 293 | { |
| 294 | // Shutdown part 1: prepare shutdown |
| 295 | if(!fRequestRestart) { |
| 296 | PrepareShutdown(); |
| 297 | } |
| 298 | |
| 299 | // Shutdown part 2: delete wallet instance |
| 300 | StopLuxControl(); |
| 301 | #ifdef ENABLE_WALLET |
| 302 | delete pwalletMain; |
| 303 | pwalletMain = NULL; |
| 304 | #endif |
| 305 | globalVerifyHandle.reset(); |
| 306 | ECC_Stop(); |
| 307 | LogPrintf("%s: done\n", __func__); |
| 308 | } |
| 309 | |
| 310 | /** |
| 311 | * Signal handlers are very limited in what they are allowed to do, so: |
no test coverage detected