fix(common): release retained cache and log memory

Dispose contact caches with account sessions and prevent late loads from restoring timers. Release discarded log content while preserving visible text.

Refs #651
This commit is contained in:
DrSmoothl committed 2026-11-04 23:23:44 +08:00
1 parent ae1ec3be0e
commit b6b433af98
8 files changed
+226 -1

No files matched your search

@@ -132,6 +132,12 @@ export class ContactsApi {
constructor(private readonly ctx: BridgeContext) {}
dispose(): void {
// Late roster responses must not start new profile loads after shutdown.
this.memberListCache.dispose();
this.friendProfiles.dispose();
}
private fetchRobotUinRanges(groupId: number): Promise<RobotUinRangeSnapshot> {
if (this.robotUinRangesPromise_) {
return this.robotUinRangesPromise_;
+1
View File
@@ -102,6 +102,7 @@ export class Bridge implements BridgeInterface {
this.disposePromise_ = (async () => {
try {
await Promise.allSettled(this.pendingPackets_);
this.apis.contacts.dispose();
await this.identity.close();
} finally {
this.events.clear();