From c7e4492846338907006b1476aeda8ac2a11ca883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 1 Sep 2019 19:33:03 +0200 Subject: [PATCH] Fix DatabasePool.change(passphrase:) --- GRDB/Core/DatabasePool.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/GRDB/Core/DatabasePool.swift b/GRDB/Core/DatabasePool.swift index 927ad74fc..f66f62539 100644 --- a/GRDB/Core/DatabasePool.swift +++ b/GRDB/Core/DatabasePool.swift @@ -243,10 +243,11 @@ extension DatabasePool { /// Changes the passphrase of an encrypted database public func change(passphrase: String) throws { - try readerPool.clear(andThen: { + try readerPool.barrier { try writer.sync { try $0.change(passphrase: passphrase) } + readerPool.removeAll() readerConfig.passphrase = passphrase - }) + } } } #endif