diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2019-08-06 15:06:27 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2019-08-06 15:06:27 -0500 |
| commit | 55b4425c5db5d25e72dc9089d9ec5aac4f2c5ddf (patch) | |
| tree | 0f07dee2c4b7a0d16d7188997234613fada14122 | |
| parent | dc49d7af38da8cd8c3847c552713cff00b66341a (diff) | |
| parent | f666e6f42eb631846e992183d6df5e67f57a4f70 (diff) | |
| download | monzero-gui-55b4425c5db5d25e72dc9089d9ec5aac4f2c5ddf.tar.gz monzero-gui-55b4425c5db5d25e72dc9089d9ec5aac4f2c5ddf.tar.xz monzero-gui-55b4425c5db5d25e72dc9089d9ec5aac4f2c5ddf.zip | |
Merge pull request #2335
f666e6f main: don't attempt to close already closed wallet (xiphon)
| -rw-r--r-- | main.qml | 41 |
1 files changed, 22 insertions, 19 deletions
@@ -239,7 +239,6 @@ ApplicationWindow { if (typeof currentWallet !== "undefined" && currentWallet !== null) { console.log("Daemon change - closing " + currentWallet) closeWallet(); - currentWallet = undefined } else if (!walletInitialized) { // set page to transfer if not changing daemon middlePanel.state = "Transfer"; @@ -286,25 +285,30 @@ ApplicationWindow { function closeWallet(callback) { // Disconnect all listeners - if (typeof currentWallet !== "undefined" && currentWallet !== null) { - currentWallet.heightRefreshed.disconnect(onHeightRefreshed); - currentWallet.refreshed.disconnect(onWalletRefresh) - currentWallet.updated.disconnect(onWalletUpdate) - currentWallet.newBlock.disconnect(onWalletNewBlock) - currentWallet.moneySpent.disconnect(onWalletMoneySent) - currentWallet.moneyReceived.disconnect(onWalletMoneyReceived) - currentWallet.unconfirmedMoneyReceived.disconnect(onWalletUnconfirmedMoneyReceived) - currentWallet.transactionCreated.disconnect(onTransactionCreated) - currentWallet.connectionStatusChanged.disconnect(onWalletConnectionStatusChanged) - currentWallet.deviceButtonRequest.disconnect(onDeviceButtonRequest); - currentWallet.deviceButtonPressed.disconnect(onDeviceButtonPressed); - currentWallet.transactionCommitted.disconnect(onTransactionCommitted); - middlePanel.paymentClicked.disconnect(handlePayment); - middlePanel.sweepUnmixableClicked.disconnect(handleSweepUnmixable); - middlePanel.getProofClicked.disconnect(handleGetProof); - middlePanel.checkProofClicked.disconnect(handleCheckProof); + if (typeof currentWallet === "undefined" || currentWallet === null) { + if (callback) { + callback(); + } + return; } + currentWallet.heightRefreshed.disconnect(onHeightRefreshed); + currentWallet.refreshed.disconnect(onWalletRefresh) + currentWallet.updated.disconnect(onWalletUpdate) + currentWallet.newBlock.disconnect(onWalletNewBlock) + currentWallet.moneySpent.disconnect(onWalletMoneySent) + currentWallet.moneyReceived.disconnect(onWalletMoneyReceived) + currentWallet.unconfirmedMoneyReceived.disconnect(onWalletUnconfirmedMoneyReceived) + currentWallet.transactionCreated.disconnect(onTransactionCreated) + currentWallet.connectionStatusChanged.disconnect(onWalletConnectionStatusChanged) + currentWallet.deviceButtonRequest.disconnect(onDeviceButtonRequest); + currentWallet.deviceButtonPressed.disconnect(onDeviceButtonPressed); + currentWallet.transactionCommitted.disconnect(onTransactionCommitted); + middlePanel.paymentClicked.disconnect(handlePayment); + middlePanel.sweepUnmixableClicked.disconnect(handleSweepUnmixable); + middlePanel.getProofClicked.disconnect(handleGetProof); + middlePanel.checkProofClicked.disconnect(handleCheckProof); + currentWallet = undefined; appWindow.showProcessingSplash(qsTr("Closing wallet...")); @@ -1122,7 +1126,6 @@ ApplicationWindow { clearMoneroCardLabelText(); walletInitialized = false; closeWallet(function() { - currentWallet = undefined; wizard.restart(); wizard.wizardState = "wizardHome"; rootItem.state = "wizard" |
