Custom deleter for shared_ptr .
| 193 | |
| 194 | // Custom deleter for shared_ptr<CWallet>. |
| 195 | static void ReleaseWallet(CWallet* wallet) |
| 196 | { |
| 197 | const std::string name = wallet->GetName(); |
| 198 | wallet->WalletLogPrintf("Releasing wallet\n"); |
| 199 | wallet->Flush(); |
| 200 | delete wallet; |
| 201 | // Wallet is now released, notify UnloadWallet, if any. |
| 202 | { |
| 203 | LOCK(g_wallet_release_mutex); |
| 204 | if (g_unloading_wallet_set.erase(name) == 0) { |
| 205 | // UnloadWallet was not called for this wallet, all done. |
| 206 | return; |
| 207 | } |
| 208 | } |
| 209 | g_wallet_release_cv.notify_all(); |
| 210 | } |
| 211 | |
| 212 | void UnloadWallet(std::shared_ptr<CWallet>&& wallet) |
| 213 | { |
nothing calls this directly
no test coverage detected