BF: Release room data source created to display messages in the past

This commit is contained in:
manuroe
2016-06-08 17:01:01 +02:00
parent 377ff9ab4b
commit 88df216daa
+6 -4
View File
@@ -399,12 +399,13 @@
if (_currentRoomViewController)
{
if (_currentRoomViewController.roomDataSource && _currentRoomViewController.roomDataSource.isLive)
if (_currentRoomViewController.roomDataSource)
{
// Let the manager release this live room data source
MXSession *mxSession = _currentRoomViewController.roomDataSource.mxSession;
MXKRoomDataSourceManager *roomDataSourceManager = [MXKRoomDataSourceManager sharedManagerForMatrixSession:mxSession];
[roomDataSourceManager closeRoomDataSource:_currentRoomViewController.roomDataSource forceClose:NO];
// Let the manager release this live room data source
[roomDataSourceManager closeRoomDataSource:_currentRoomViewController.roomDataSource forceClose:!_currentRoomViewController.roomDataSource.isLive];
}
[_currentRoomViewController destroy];
@@ -621,7 +622,8 @@
}
else
{
[_currentRoomViewController displayRoomPreview:_selectedRoomPreviewData];
[_currentRoomViewController displayRoom:_selectedRoomPreviewData.roomDataSource];
//[_currentRoomViewController displayRoomPreview:_selectedRoomPreviewData];
_selectedRoomPreviewData = nil;
}
}