From 6d946d0cb0c2acd93a37fb404e94ccf0d690e6dd Mon Sep 17 00:00:00 2001 From: craig-at-rsg Date: Tue, 5 Sep 2017 19:37:43 -0400 Subject: [PATCH] Update SQLitePlugin.m & plugin.xml to use PSPDFThreadSafeMutableDictionary (iOS/macOS) with minor changes by @brodybits: - import PSPDFThreadSafeMutableDictionary in SQLitePlugin.m instead of SQLitePlugin.h - update SQLitePlugin.m & plugin.xml in single commit - update plugin version - update docs ref: litehelpers/Cordova-sqlite-storage#716 --- CHANGES.md | 4 ++++ LICENSE.md | 2 +- README.md | 1 + package.json | 2 +- plugin.xml | 10 +++++++++- src/ios/SQLitePlugin.m | 4 +++- 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6b1c2daf8..968eb4fe2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changes +###### cordova-sqlite-legacy-express-core 1.0.2 + +- Use PSPDFThreadSafeMutableDictionary for iOS/macOS to avoid threading issue ref: litehelpers/Cordova-sqlite-storage#716 + ###### cordova-sqlite-legacy-express-core 1.0.1 - Fix bug 666 workaround to trigger ROLLBACK in the next event tick (needed to support version with pre-populated database on Windows) diff --git a/LICENSE.md b/LICENSE.md index d257c7fcf..23233c14e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -14,7 +14,7 @@ MIT only based on Phonegap-SQLitePlugin by @davibe (Davide Bertola ) and @joenoon (Joe Noon ) -includes PSPDFThreadSafeMutableDictionary (PSPDFThreadSafeMutableDictionary.m ) MIT license by @steipete () +includes and uses PSPDFThreadSafeMutableDictionary (PSPDFThreadSafeMutableDictionary.m ) MIT license by @steipete () ## REMOVED from this version branch: Windows (8.1/...) version diff --git a/README.md b/README.md index 5f6e44d3b..4e99f8554 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ Use the `location` or `iosDatabaseLocation` option in `sqlitePlugin.openDatabase ## Announcements +- Fixed iOS/macOS platform version to use [PSPDFThreadSafeMutableDictionary.m](https://gist.github.com/steipete/5928916) to avoid threading issue ref: [litehelpers/Cordova-sqlite-storage#716](https://github.com/litehelpers/Cordova-sqlite-storage/issues/716) - Resolved transaction problem after window.location (page) change with possible data loss ref: [litehelpers/Cordova-sqlite-storage#666](https://github.com/litehelpers/Cordova-sqlite-storage/issues/666) - [brodybits / cordova-sqlite-test-app](https://github.com/brodybits/cordova-sqlite-test-app) project is a CC0 (public domain) starting point (NOTE that this plugin must be added) and may also be used to reproduce issues with this plugin. - The Lawnchair adapter is now moved to [litehelpers / cordova-sqlite-lawnchair-adapter](https://github.com/litehelpers/cordova-sqlite-lawnchair-adapter). diff --git a/package.json b/package.json index d2050a2d7..9950f0d74 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-sqlite-legacy-express-core", - "version": "1.0.2-pre00", + "version": "1.0.2", "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 74aad5c4b..a0a873850 100644 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="1.0.2"> Cordova sqlite storage plugin - legacy express core version @@ -41,6 +41,10 @@ + + + + @@ -55,6 +59,10 @@ + + + + diff --git a/src/ios/SQLitePlugin.m b/src/ios/SQLitePlugin.m index d1ff85c4e..a56bf5ad2 100755 --- a/src/ios/SQLitePlugin.m +++ b/src/ios/SQLitePlugin.m @@ -10,6 +10,8 @@ #import "sqlite3.h" +#import "PSPDFThreadSafeMutableDictionary.h" + // FUTURE TBD (in another version branch): //#define READ_BLOB_AS_BASE64 @@ -27,7 +29,7 @@ -(void)pluginInitialize NSLog(@"Initializing SQLitePlugin"); { - openDBs = [NSMutableDictionary dictionaryWithCapacity:0]; + openDBs = [PSPDFThreadSafeMutableDictionary dictionaryWithCapacity:0]; appDBPaths = [NSMutableDictionary dictionaryWithCapacity:0]; #if !__has_feature(objc_arc) [openDBs retain];