Room messages preview: Release peeking room data source better

This commit is contained in:
manuroe
2016-06-09 11:52:39 +02:00
parent 2e62b485ba
commit d82b1fbe4d
2 changed files with 7 additions and 9 deletions
+3 -5
View File
@@ -48,13 +48,11 @@
[_mxSession peekInRoomWithRoomId:_roomId success:^(MXPeekingRoom *peekingRoom) {
// Create the room data source
// It will be automatically released when the RoomViewController that displays it will disappear
_roomDataSource = [[RoomDataSource alloc] initWithPeekingRoom:peekingRoom AndInitialEventId:_eventId];
// It will be automatically released in the destroy metho of the RoomViewController
// that will display the data source
_roomDataSource = [[RoomDataSource alloc] initWithPeekingRoom:peekingRoom andInitialEventId:_eventId];
[_roomDataSource finalizeInitialization];
MXKRoomDataSourceManager *roomDataSourceManager = [MXKRoomDataSourceManager sharedManagerForMatrixSession:_mxSession];
[roomDataSourceManager addRoomDataSource:_roomDataSource];
_roomName = peekingRoom.state.displayname;
_roomAvatarUrl = peekingRoom.state.avatar;