Fix retain cycle in MXKRoomDataSource

Relates to: #5058
Signed-off-by: Johannes Marbach <johannesm@element.io>
This commit is contained in:
Johannes Marbach
2022-03-27 20:51:02 +02:00
parent 1dc0d38d21
commit b86d0a6148
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)
{