Merge pull request #5923 from vector-im/johannes/5058_room_data_source_leak

Fix retain cycle in MXKRoomDataSource
This commit is contained in:
Doug
2022-03-29 12:10:36 +01:00
committed by GitHub
2 changed files with 4 additions and 0 deletions
@@ -1075,8 +1075,11 @@ typedef NS_ENUM (NSUInteger, MXKRoomDataSourceError) {
}
// 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)
{