Skip to content

Commit

Permalink
delete wallet from worker on close
Browse files Browse the repository at this point in the history
  • Loading branch information
woodser committed Jan 27, 2024
1 parent 38c7724 commit 6560168
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/ts/common/MoneroWebWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -994,9 +994,10 @@ self.changePassword = async function(walletId, oldPassword, newPassword) {
}

self.isClosed = async function(walletId) {
return self.WORKER_OBJECTS[walletId].isClosed();
return !self.WORKER_OBJECTS[walletId] || self.WORKER_OBJECTS[walletId].isClosed();
}

self.close = async function(walletId, save) {
return self.WORKER_OBJECTS[walletId].close(save); // TODO: remove listeners and delete wallet from WORKER_OBJECTS
return self.WORKER_OBJECTS[walletId].close(save);
delete self.WORKER_OBJECTS[walletId];
}

0 comments on commit 6560168

Please sign in to comment.