From 7572e388b0ac8aa2dca373128f242f5f335b01e4 Mon Sep 17 00:00:00 2001 From: "Christopher J. Brody" Date: Mon, 1 Jan 2018 17:31:05 -0500 Subject: [PATCH] iOS/macOS @synchronized guard for sqlite3_open operation --- CHANGES.md | 3 ++- package.json | 2 +- plugin.xml | 2 +- src/ios/SQLitePlugin.m | 6 +++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index cf9773f67..d8deede04 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,8 @@ # Changes -###### cordova-sqlite-legacy-express-core 1.0.5-pre02 +###### cordova-sqlite-legacy-express-core 1.0.5 +- iOS/macOS @synchronized guard for sqlite3_open operation - Signal INTERNAL ERROR in case of attempt to reuse db (Android/iOS) (should never happen due to workaround solution to BUG 666) ###### cordova-sqlite-legacy-express-core 1.0.4 diff --git a/package.json b/package.json index 9c4a2b47e..1b3fb1861 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-sqlite-legacy-express-core", - "version": "1.0.5-pre02", + "version": "1.0.5", "description": "Native interface to SQLite for PhoneGap/Cordova (legacy express core version)", "cordova": { "id": "cordova-sqlite-legacy-express-core", diff --git a/plugin.xml b/plugin.xml index aecd531ad..c18d3557a 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="1.0.5"> Cordova sqlite storage plugin - legacy express core version diff --git a/src/ios/SQLitePlugin.m b/src/ios/SQLitePlugin.m index 6575b4902..50a98b264 100755 --- a/src/ios/SQLitePlugin.m +++ b/src/ios/SQLitePlugin.m @@ -128,7 +128,11 @@ -(void)openNow: (CDVInvokedUrlCommand*)command // NO LONGER EXPECTED due to BUG 666 workaround solution: NSLog(@"INTERNAL ERROR: database already open for db name: %@ (db file name: %@)", dbname, dbfilename); pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR messageAsString: @"INTERNAL ERROR: database already open"]; - } else { + [self.commandDelegate sendPluginResult:pluginResult callbackId: command.callbackId]; + return; + } + + @synchronized(self) { const char *name = [dbname UTF8String]; sqlite3 *db;