RecentsDataSource: Memory leak in [RecentsDataSource dataSource:didStateChange:]

This commit is contained in:
manuroe
2021-10-01 11:34:39 +01:00
2 changed files with 4 additions and 0 deletions

View File

@@ -421,9 +421,12 @@ NSString *const kRecentsDataSourceTapOnDirectoryServerChange = @"kRecentsDataSou
if ((aState == MXKDataSourceStateReady) && dataSource.mxSession.myUser.userId)
{
// Register the room tags updates to refresh the favorites order
MXWeakify(self);
id roomTagsListener = [dataSource.mxSession listenToEventsOfTypes:@[kMXEventTypeStringRoomTag]
onEvent:^(MXEvent *event, MXTimelineDirection direction, id customObject) {
MXStrongifyAndReturnIfNil(self);
// Consider only live event
if (direction == MXTimelineDirectionForwards)
{