1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-12 06:01:13 +02:00

AUP3: Ensure that the update hook is removed

This commit is contained in:
Leland Lucius 2020-07-13 09:08:31 -05:00
parent 25d9e1c387
commit 6193598b90

View File

@ -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