forked from mirrors/linphone-iphone
Fix database opening if original file doesn't exist
This commit is contained in:
parent
22e828cace
commit
eb96fdc9d3
3 changed files with 5 additions and 1 deletions
|
|
@ -234,6 +234,10 @@ struct codec_name_pref_table codec_pref_table[]={
|
|||
if ([fileManager fileExistsAtPath:databaseDocumentPath] == NO) {
|
||||
[LinphoneLogger logc:LinphoneLoggerLog format:"Create sqlite3 database"];
|
||||
NSString *resourceDocumentPath = [[NSBundle mainBundle] pathForResource:@"database" ofType:@"sqlite"];
|
||||
if ([fileManager fileExistsAtPath:resourceDocumentPath] == NO) {
|
||||
[LinphoneLogger log:LinphoneLoggerError format:@"Can't find original database: %@", [error localizedDescription]];
|
||||
return;
|
||||
}
|
||||
[fileManager copyItemAtPath:resourceDocumentPath toPath:databaseDocumentPath error:&error];
|
||||
if(error != nil) {
|
||||
[LinphoneLogger log:LinphoneLoggerError format:@"Can't copy database: %@", [error localizedDescription]];
|
||||
|
|
|
|||
|
|
@ -245,6 +245,7 @@
|
|||
}
|
||||
|
||||
- (void)didReceiveMemoryWarning {
|
||||
[super didReceiveMemoryWarning];
|
||||
[self clearCache];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@
|
|||
@private
|
||||
UICompositeViewController *mainViewController;
|
||||
|
||||
UIActionSheet *incomingCallActionSheet;
|
||||
UIActionSheet *batteryActionSheet;
|
||||
|
||||
int loadCount;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue