Fix crash on exit if cancelling open and exiting

This commit is contained in:
moneromooo.monero 2016-11-18 21:39:06 +00:00
parent c83336cc47
commit 708eb43c3e

View File

@ -603,7 +603,10 @@ ApplicationWindow {
walletInitialized = false; walletInitialized = false;
splashCounter = 0; splashCounter = 0;
// we can't close async here. Gui crashes if wallet is open // we can't close async here. Gui crashes if wallet is open
if (currentWallet != undefined) {
walletManager.closeWallet(currentWallet); walletManager.closeWallet(currentWallet);
currentWallet = undefined
}
wizard.restart(); wizard.restart();
rootItem.state = "wizard" rootItem.state = "wizard"
@ -1026,6 +1029,9 @@ ApplicationWindow {
} }
onClosing: { onClosing: {
// Close and save to disk on app close // Close and save to disk on app close
if (currentWallet != undefined) {
walletManager.closeWallet(currentWallet); walletManager.closeWallet(currentWallet);
currentWallet = undefined
}
} }
} }