1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-22 15:58:45 +01:00

Merge pull request #6375 from jonaski/database

Fix memory leaks in database
This commit is contained in:
John Maguire 2019-07-25 18:38:35 +01:00 committed by GitHub
commit ec2e8be4d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -262,7 +262,7 @@ QSqlDatabase Database::Connect() {
}
// Find Sqlite3 functions in the Qt plugin.
StaticInit();
if (!sFTSTokenizer) StaticInit();
{
@ -666,7 +666,7 @@ void Database::BackupFile(const QString& filename) {
sqlite3* source_connection = nullptr;
sqlite3* dest_connection = nullptr;
BOOST_SCOPE_EXIT((source_connection)(dest_connection)(task_id)(app_)) {
BOOST_SCOPE_EXIT((&source_connection)(&dest_connection)(task_id)(app_)) {
// Harmless to call sqlite3_close() with a nullptr pointer.
sqlite3_close(source_connection);
sqlite3_close(dest_connection);