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
+4 -4
View File
@@ -399,15 +399,15 @@
if (_currentRoomViewController)
{
if (_currentRoomViewController.roomDataSource)
if (_currentRoomViewController.roomDataSource
&& _currentRoomViewController.roomDataSource.isLive
&& !_currentRoomViewController.roomDataSource.isPeeking)
{
MXSession *mxSession = _currentRoomViewController.roomDataSource.mxSession;
MXKRoomDataSourceManager *roomDataSourceManager = [MXKRoomDataSourceManager sharedManagerForMatrixSession:mxSession];
// Let the manager release live room data sources where the user is in
// and force close all others.
BOOL forceClose = !_currentRoomViewController.roomDataSource.isLive || _currentRoomViewController.roomDataSource.isPeeking;
[roomDataSourceManager closeRoomDataSource:_currentRoomViewController.roomDataSource forceClose:forceClose];
[roomDataSourceManager closeRoomDataSource:_currentRoomViewController.roomDataSource forceClose:NO];
}
[_currentRoomViewController destroy];