From 6193598b90a973121d7e51c81d067f6df0936825 Mon Sep 17 00:00:00 2001 From: Leland Lucius Date: Mon, 13 Jul 2020 09:08:31 -0500 Subject: [PATCH] AUP3: Ensure that the update hook is removed --- src/ProjectFileIO.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ProjectFileIO.cpp b/src/ProjectFileIO.cpp index 20cf3fc76..5ce555e83 100644 --- a/src/ProjectFileIO.cpp +++ b/src/ProjectFileIO.cpp @@ -726,7 +726,6 @@ bool ProjectFileIO::CheckForOrphans(BlockIDs &blockids) return true; } - /* static */ void ProjectFileIO::UpdateCallback(void *data, int operation, char const *dbname, char const *table, int64_t rowid) { @@ -775,6 +774,9 @@ sqlite3 *ProjectFileIO::CopyTo(const FilePath &destpath, bool prune /* = false * // Remove our function, whether it was successfully defined or not. sqlite3_create_function(db, "inset", 1, SQLITE_UTF8 | SQLITE_DETERMINISTIC, nullptr, nullptr, nullptr, nullptr); + // Remove the update hook, whether it was successfully defined or not. + sqlite3_update_hook(db, nullptr, nullptr); + if (!success) { sqlite3_close(destdb); @@ -828,7 +830,6 @@ sqlite3 *ProjectFileIO::CopyTo(const FilePath &destpath, bool prune /* = false * count++; }; sqlite3_update_hook(db, UpdateCallback, &update); - sqlite3_wal_autocheckpoint(db, 0); // The first version is a better solution, but after the rows get copied // there's a large delay when processing large files. This is due to the