Fix crash when coming back from background when LinphoneCore has been destroyed

This commit is contained in:
Guillaume BIENKOWSKI 2014-10-15 17:07:14 +02:00
parent cc60cb6389
commit 78807b9e1a

View file

@ -1868,17 +1868,19 @@ static void audioRouteChangeListenerCallback (
}
+ (int)unreadMessageCount {
int count = 0;
MSList* rooms = linphone_core_get_chat_rooms([LinphoneManager getLc]);
MSList* item = rooms;
while (item) {
LinphoneChatRoom* room = (LinphoneChatRoom*)item->data;
if( room ){
count += linphone_chat_room_get_unread_messages_count(room);
}
item = item->next;
}
return count;
int count = 0;
if( [LinphoneManager isLcReady] ){
MSList* rooms = linphone_core_get_chat_rooms([LinphoneManager getLc]);
MSList* item = rooms;
while (item) {
LinphoneChatRoom* room = (LinphoneChatRoom*)item->data;
if( room ){
count += linphone_chat_room_get_unread_messages_count(room);
}
item = item->next;
}
}
return count;
}
+ (BOOL)copyFile:(NSString*)src destination:(NSString*)dst override:(BOOL)override {