Skip to content

Commit 7d061b7

Browse files
committed
Fixed contract once not running stop callback.
1 parent 3c17cf5 commit 7d061b7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src.ts/contract/contract.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,12 @@ async function _emit(contract: BaseContract, event: ContractEventName, args: Arr
593593
} catch (error) { }
594594
return !once;
595595
});
596+
597+
if (sub.listeners.length === 0) {
598+
sub.stop();
599+
getInternal(contract).subs.delete(sub.tag);
600+
}
601+
596602
return (count > 0);
597603
}
598604

0 commit comments

Comments
 (0)