qml: LoadingWalletDialog: fix ressource leak
When closing the OpenWalletDialog without unlocking a wallet the LoadingWalletDialog wouldn't get properly cleaned up as the LoadingWalletDialog.visible was never set true. This causes the connections to accumulate and the callbacks won't get unregistered after closing the LoadingWalletDialog again.
This commit is contained in:
@@ -44,7 +44,13 @@ ElDialog {
|
||||
console.log('daemon loading ' + Daemon.loading)
|
||||
if (!Daemon.loading) {
|
||||
showTimer.stop()
|
||||
dialog.close()
|
||||
if (dialog.visible) {
|
||||
dialog.close()
|
||||
} else {
|
||||
// if the dialog wasn't visible its onClosed callbacks don't get called, so it
|
||||
// needs to be destroyed manually
|
||||
Qt.callLater(function() { dialog.destroy() })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user