From b59f37bc0a485113d0500c71bf179781f509e61f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 20 Feb 2019 22:50:15 +0100 Subject: [PATCH] db/simple/Directory: close the Database in destructor Fixes assertion failure. --- NEWS | 1 + src/db/plugins/simple/Directory.cxx | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/NEWS b/NEWS index 40cfa264a..16b23fff8 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ ver 0.21.5 (not yet released) - fix "tagtypes disable" command * database - simple: fix assertion failure + - fix assertion failures with mount points * input - buffer: fix crash bug when playing remote WAV file * tags diff --git a/src/db/plugins/simple/Directory.cxx b/src/db/plugins/simple/Directory.cxx index a1f2d15e4..27602afc2 100644 --- a/src/db/plugins/simple/Directory.cxx +++ b/src/db/plugins/simple/Directory.cxx @@ -45,6 +45,11 @@ Directory::Directory(std::string &&_path_utf8, Directory *_parent) noexcept Directory::~Directory() noexcept { + if (mounted_database != nullptr) { + mounted_database->Close(); + mounted_database.reset(); + } + songs.clear_and_dispose(Song::Disposer()); children.clear_and_dispose(DeleteDisposer()); }