Skip to content

Commit e1ba3fe

Browse files
committed
fix potential memory leak
1 parent 75521a1 commit e1ba3fe

File tree

1 file changed

+3
-1
lines changed
  • packages/thirdweb/src/wallets/manager

1 file changed

+3
-1
lines changed

packages/thirdweb/src/wallets/manager/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ export function createConnectionManager(storage: AsyncStorage) {
150150
handleSetActiveWallet(activeWallet);
151151

152152
wallet.subscribe("accountChanged", async () => {
153-
connect(wallet, options);
153+
// We reimplement connect here to prevent memory leaks
154+
const newWallet = await handleConnection(wallet, options);
155+
options?.onConnect?.(newWallet);
154156
});
155157

156158
return activeWallet;

0 commit comments

Comments
 (0)