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:
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_;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user