diff --git a/src.ts/contract/contract.ts b/src.ts/contract/contract.ts index 415712163..4c972667a 100644 --- a/src.ts/contract/contract.ts +++ b/src.ts/contract/contract.ts @@ -593,6 +593,12 @@ async function _emit(contract: BaseContract, event: ContractEventName, args: Arr } catch (error) { } return !once; }); + + if (sub.listeners.length === 0) { + sub.stop(); + getInternal(contract).subs.delete(sub.tag); + } + return (count > 0); }