]> Untitled Git - bitcoindevkit.org/commitdiff
Fix the wallet's "stop button"
authorDaniela Brozzoni <danielabrozzoni@protonmail.com>
Wed, 14 Sep 2022 13:24:05 +0000 (15:24 +0200)
committerDaniela Brozzoni <danielabrozzoni@protonmail.com>
Thu, 6 Oct 2022 11:22:12 +0000 (12:22 +0100)
The stop button wouldn't work as it was calling `currentWallet.free()`,
which is not defined. Instead, assigning null to currentWallet and let
the garbage collector do its thing.

playground/src/index.js

index d0d3642b097ac2f7c2f85417b2f63c502e75d21f..820e13e19c4b7b7f76442f4f10aa60b60d61978b 100644 (file)
@@ -127,7 +127,7 @@ async function startWallet(desc, change_desc) {
 
         e.preventDefault();
 
-        currentWallet.free();
+        currentWallet = null;
         start_message.innerHTML = "Wallet instance destroyed";
 
         start_button.disabled = false;