Skip to content

Commit

Permalink
Fix retain cycle in MXKRoomDataSource
Browse files Browse the repository at this point in the history
Relates to: #5058
Signed-off-by: Johannes Marbach <[email protected]>
  • Loading branch information
Johennes committed Mar 27, 2022
1 parent 4bda8da commit 945f810
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Riot/Modules/MatrixKit/Models/Room/MXKRoomDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -1075,8 +1075,11 @@ - (void)refreshEventListeners:(NSArray *)liveEventTypesFilterForMessages
}

// Register a listener to handle redaction which can affect live and past timelines
MXWeakify(self);
redactionListener = [_timeline listenToEventsOfTypes:@[kMXEventTypeStringRoomRedaction] onEvent:^(MXEvent *redactionEvent, MXTimelineDirection direction, MXRoomState *roomState) {

MXStrongifyAndReturnIfNil(self);

// Consider only live redaction events
if (direction == MXTimelineDirectionForwards)
{
Expand Down
1 change: 1 addition & 0 deletions changelog.d/5058.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MXKRoomDataSource: Fix retain cycle

0 comments on commit 945f810

Please sign in to comment.