diff --git a/Monal/Classes/MLMucProcessor.m b/Monal/Classes/MLMucProcessor.m index 1dd7161fe7..59dca2b9f7 100644 --- a/Monal/Classes/MLMucProcessor.m +++ b/Monal/Classes/MLMucProcessor.m @@ -93,11 +93,11 @@ -(NSDictionary*) getInternalState @synchronized(_stateLockObject) { NSDictionary* state = @{ @"version": CURRENT_MUC_STATE_VERSION, - @"roomFeatures": _roomFeatures, - @"joining": _joining, - @"firstJoin": _firstJoin, - @"lastPing": _lastPing, - @"noUpdateBookmarks": _noUpdateBookmarks, + @"roomFeatures": [_roomFeatures copy], + @"joining": [_joining copy], + @"firstJoin": [_firstJoin copy], + @"lastPing": _lastPing copy, + @"noUpdateBookmarks": [_noUpdateBookmarks copy], @"hasFetchedBookmarks": @(_hasFetchedBookmarks), }; //DDLogVerbose(@"Returning MUC state: %@", state); diff --git a/Monal/Classes/xmpp.m b/Monal/Classes/xmpp.m index 4423b0085f..81401488b9 100644 --- a/Monal/Classes/xmpp.m +++ b/Monal/Classes/xmpp.m @@ -3344,7 +3344,7 @@ -(void) realPersistState [values setObject:persistentIqHandlers forKey:@"iqHandlers"]; @synchronized(self->_reconnectionHandlers) { - [values setObject:self->_reconnectionHandlers forKey:@"reconnectionHandlers"]; + [values setObject:[self->_reconnectionHandlers copy] forKey:@"reconnectionHandlers"]; } [values setValue:[self.connectionProperties.serverFeatures copy] forKey:@"serverFeatures"]; @@ -3355,8 +3355,8 @@ -(void) realPersistState [values setObject:[self.pubsub getInternalData] forKey:@"pubsubData"]; [values setObject:[self.mucProcessor getInternalState] forKey:@"mucState"]; - [values setObject:self->_runningCapsQueries forKey:@"runningCapsQueries"]; - [values setObject:self->_runningMamQueries forKey:@"runningMamQueries"]; + [values setObject:[self->_runningCapsQueries copy] forKey:@"runningCapsQueries"]; + [values setObject:[self->_runningMamQueries copy] forKey:@"runningMamQueries"]; [values setObject:[NSNumber numberWithBool:self->_loggedInOnce] forKey:@"loggedInOnce"]; [values setObject:[NSNumber numberWithBool:self.connectionProperties.usingCarbons2] forKey:@"usingCarbons2"]; [values setObject:[NSNumber numberWithBool:self.connectionProperties.supportsBookmarksCompat] forKey:@"supportsBookmarksCompat"];