diff --git a/CHANGELOG.md b/CHANGELOG.md index c0d1c4f8c..a68c5a831 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception: -- `5.0.x` Releases - [5.0.0](#500) | [5.0.1](#501) | [5.0.2](#502) +- `5.0.x` Releases - [5.0.0](#500) | [5.0.1](#501) | [5.0.2](#502) | [5.0.3](#503) - `5.0.0` Betas - [5.0.0-beta](#500-beta) | [5.0.0-beta.2](#500-beta2) | [5.0.0-beta.3](#500-beta3) | [5.0.0-beta.4](#500-beta4) | [5.0.0-beta.5](#500-beta5) | [5.0.0-beta.6](#500-beta6) | [5.0.0-beta.7](#500-beta7) | [5.0.0-beta.8](#500-beta8) | [5.0.0-beta.9](#500-beta9) | [5.0.0-beta.10](#500-beta10) | [5.0.0-beta.11](#500-beta11) @@ -69,6 +69,13 @@ GRDB adheres to [Semantic Versioning](https://semver.org/), with one exception: - [0.110.0](#01100), ... +## 5.0.3 + +Released October 25, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.2...v5.0.3) + +- **Fixed**: [#859](https://github.com/groue/GRDB.swift/pull/859): Database.close() is idempotent + + ## 5.0.2 Released October 6, 2020 • [diff](https://github.com/groue/GRDB.swift/compare/v5.0.1...v5.0.2) diff --git a/Documentation/AssociationsBasics.md b/Documentation/AssociationsBasics.md index b057948dd..9fb15f9f3 100644 --- a/Documentation/AssociationsBasics.md +++ b/Documentation/AssociationsBasics.md @@ -116,7 +116,7 @@ Loading all books from an existing author is now easier: let books = try author.books.fetchAll(db) ``` -As for loading all pairs of books and authors, it is not only easier, but also *far much efficient*: +As for loading all pairs of books and authors, it is not only easier, but also *much more efficient*: ```swift struct BookInfo: FetchableRecord, Decodable { diff --git a/Documentation/Playgrounds/Associations.playground/contents.xcplayground b/Documentation/Playgrounds/Associations.playground/contents.xcplayground index 63b6dd8df..a8211e594 100644 --- a/Documentation/Playgrounds/Associations.playground/contents.xcplayground +++ b/Documentation/Playgrounds/Associations.playground/contents.xcplayground @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/Documentation/Playgrounds/CustomizedDecodingOfDatabaseRows.playground/contents.xcplayground b/Documentation/Playgrounds/CustomizedDecodingOfDatabaseRows.playground/contents.xcplayground index 3a493ef23..ec88aeaa8 100644 --- a/Documentation/Playgrounds/CustomizedDecodingOfDatabaseRows.playground/contents.xcplayground +++ b/Documentation/Playgrounds/CustomizedDecodingOfDatabaseRows.playground/contents.xcplayground @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/Documentation/Playgrounds/MyPlayground.playground/contents.xcplayground b/Documentation/Playgrounds/MyPlayground.playground/contents.xcplayground index 63b6dd8df..a8211e594 100644 --- a/Documentation/Playgrounds/MyPlayground.playground/contents.xcplayground +++ b/Documentation/Playgrounds/MyPlayground.playground/contents.xcplayground @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/Documentation/Playgrounds/Tour.playground/contents.xcplayground b/Documentation/Playgrounds/Tour.playground/contents.xcplayground index fd676d5b4..08c51997a 100644 --- a/Documentation/Playgrounds/Tour.playground/contents.xcplayground +++ b/Documentation/Playgrounds/Tour.playground/contents.xcplayground @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/Documentation/Playgrounds/TransactionObserver.playground/contents.xcplayground b/Documentation/Playgrounds/TransactionObserver.playground/contents.xcplayground index 3de2b51ba..3e9bf27b1 100644 --- a/Documentation/Playgrounds/TransactionObserver.playground/contents.xcplayground +++ b/Documentation/Playgrounds/TransactionObserver.playground/contents.xcplayground @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/GRDB.swift.podspec b/GRDB.swift.podspec index 69ca1a17c..9b3318914 100644 --- a/GRDB.swift.podspec +++ b/GRDB.swift.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'GRDB.swift' - s.version = '5.0.2' + s.version = '5.0.3' s.license = { :type => 'MIT', :file => 'LICENSE' } s.summary = 'A toolkit for SQLite databases, with a focus on application development.' diff --git a/GRDB/Core/Database.swift b/GRDB/Core/Database.swift index ef83e5e36..320020a8b 100644 --- a/GRDB/Core/Database.swift +++ b/GRDB/Core/Database.swift @@ -355,7 +355,10 @@ public final class Database: CustomStringConvertible, CustomDebugStringConvertib /// This method must be called before database deallocation func close() { SchedulingWatchdog.preconditionValidQueue(self) - assert(!isClosed) + + if isClosed { + return + } configuration.SQLiteConnectionWillClose?(sqliteConnection) internalStatementCache.clear() diff --git a/GRDB/Core/SerializedDatabase.swift b/GRDB/Core/SerializedDatabase.swift index f98055d43..ed7ddd08c 100644 --- a/GRDB/Core/SerializedDatabase.swift +++ b/GRDB/Core/SerializedDatabase.swift @@ -55,6 +55,12 @@ final class SerializedDatabase { do { try db.setUp() } catch { + // Recent versions of the Swift compiler will call the + // deinitializer. Older ones won't. + // See https://bugs.swift.org/browse/SR-13746 for details. + // + // So let's close the database now. The deinitializer + // will only close the database if needed. db.close() throw error } diff --git a/Makefile b/Makefile index 482062b4a..a03213113 100644 --- a/Makefile +++ b/Makefile @@ -409,8 +409,8 @@ ifdef JAZZY --author 'Gwendal Roué' \ --author_url https://github.com/groue \ --github_url https://github.com/groue/GRDB.swift \ - --github-file-prefix https://github.com/groue/GRDB.swift/tree/v5.0.2 \ - --module-version 5.0.2 \ + --github-file-prefix https://github.com/groue/GRDB.swift/tree/v5.0.3 \ + --module-version 5.0.3 \ --module GRDB \ --root-url http://groue.github.io/GRDB.swift/docs/5.0/ \ --output Documentation/Reference \ diff --git a/README.md b/README.md index 94c0d9216..d1959aad3 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,13 @@ --- -**Latest release**: October 6, 2020 • version 5.0.2 • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 4 to GRDB 5](Documentation/GRDB5MigrationGuide.md) +**Latest release**: October 6, 2020 • version 5.0.3 • [CHANGELOG](CHANGELOG.md) • [Migrating From GRDB 4 to GRDB 5](Documentation/GRDB5MigrationGuide.md) **Requirements**: iOS 10.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ • Swift 5.2+ / Xcode 11.4+ | Swift version | GRDB version | | -------------- | ----------------------------------------------------------- | -| **Swift 5.2+** | **v5.0.2** | +| **Swift 5.2+** | **v5.0.3** | | Swift 5.1 | [v4.14.0](https://github.com/groue/GRDB.swift/tree/v4.14.0) | | Swift 5 | [v4.14.0](https://github.com/groue/GRDB.swift/tree/v4.14.0) | | Swift 4.2 | [v4.14.0](https://github.com/groue/GRDB.swift/tree/v4.14.0) | diff --git a/Support/Info.plist b/Support/Info.plist index 78ab3233f..ae9b15513 100644 --- a/Support/Info.plist +++ b/Support/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 5.0.2 + 5.0.3 CFBundleSignature ???? CFBundleVersion