Skip to content

Commit

Permalink
iOS/macOS @synchronized guard for sqlite3_open operation
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher J. Brody committed Jan 1, 2018
1 parent 9cc042f commit 7572e38
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-sqlite-legacy-express-core"
version="1.0.5-pre02">
version="1.0.5">

<name>Cordova sqlite storage plugin - legacy express core version</name>

Expand Down
6 changes: 5 additions & 1 deletion src/ios/SQLitePlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7572e38

Please sign in to comment.