fix(delete): fix closing the app before login would make it crash
Fixes #12880
This commit is contained in:
parent
ce0dbe533b
commit
7c7ab85690
|
@ -477,7 +477,7 @@ proc finishAppLoading*(self: AppController) =
|
|||
self.privacyService.removeMnemonic()
|
||||
|
||||
if not self.startupModule.isNil:
|
||||
self.startupModule.delete
|
||||
self.startupModule.onAppLoaded()
|
||||
self.startupModule = nil
|
||||
|
||||
self.mainModule.checkAndPerformProfileMigrationIfNeeded()
|
||||
|
|
|
@ -44,7 +44,7 @@ QtObject:
|
|||
self.canSend = canSend
|
||||
|
||||
proc delete*(self: AccountItem) =
|
||||
self.QObject.delete
|
||||
self.QObject.delete
|
||||
|
||||
proc newAccountItem*(
|
||||
name: string = "",
|
||||
|
|
|
@ -35,11 +35,13 @@ QtObject:
|
|||
proc delete*(self: View) =
|
||||
self.accounts.delete
|
||||
self.senderAccounts.delete
|
||||
self.selectedSenderAccount.delete
|
||||
if self.selectedSenderAccount != nil:
|
||||
self.selectedSenderAccount.delete
|
||||
self.fromNetworksModel.delete
|
||||
self.toNetworksModel.delete
|
||||
self.transactionRoutes.delete
|
||||
self.selectedReceiveAccount.delete
|
||||
if self.selectedSenderAccount != nil:
|
||||
self.selectedReceiveAccount.delete
|
||||
self.QObject.delete
|
||||
|
||||
proc newView*(delegate: io_interface.AccessInterface): View =
|
||||
|
|
|
@ -19,6 +19,9 @@ type
|
|||
method delete*(self: AccessInterface) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method onAppLoaded*(self: AccessInterface) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
method load*(self: AccessInterface) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
||||
|
|
|
@ -84,6 +84,13 @@ proc newModule*[T](delegate: T,
|
|||
{.push warning[Deprecated]: off.}
|
||||
|
||||
method delete*[T](self: Module[T]) =
|
||||
self.view.delete
|
||||
self.viewVariant.delete
|
||||
self.controller.delete
|
||||
if not self.keycardSharedModule.isNil:
|
||||
self.keycardSharedModule.delete
|
||||
|
||||
method onAppLoaded*[T](self: Module[T]) =
|
||||
singletonInstance.engine.setRootContextProperty("startupModule", newQVariant())
|
||||
self.view.delete
|
||||
self.view = nil
|
||||
|
|
Loading…
Reference in New Issue