retain() in openTimeline

This commit is contained in:
RMidhunSuresh 2023-05-17 16:51:32 +05:30
parent 6b3bc37e1d
commit e92507081f
3 changed files with 1 additions and 2 deletions

View File

@ -80,7 +80,6 @@ export class RoomViewModel extends ErrorReportViewModel {
await this.logAndCatch("RoomViewModel.load", async log => { await this.logAndCatch("RoomViewModel.load", async log => {
this._room.on("change", this._onRoomChange); this._room.on("change", this._onRoomChange);
const timeline = await this._room.openTimeline(log); const timeline = await this._room.openTimeline(log);
timeline.retain();
this.track(() => timeline.release()); this.track(() => timeline.release());
this._tileOptions = this.childOptions({ this._tileOptions = this.childOptions({
session: this.getOption("session"), session: this.getOption("session"),

View File

@ -589,6 +589,7 @@ export class BaseRoom extends EventEmitter {
} finally { } finally {
resolve(); resolve();
} }
this._timeline.retain();
return this._timeline; return this._timeline;
}); });
} }

View File

@ -82,7 +82,6 @@ export class RoomChannel extends Disposables implements IChannel {
private async subscribeToTimeline() { private async subscribeToTimeline() {
const timeline = await this.room.openTimeline(); const timeline = await this.room.openTimeline();
timeline.retain();
this.track(() => timeline.release()); this.track(() => timeline.release());
this.track( this.track(
timeline.entries.subscribe({ timeline.entries.subscribe({