summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-02-20 22:50:15 +0100
committerMax Kellermann <max@musicpd.org>2019-02-20 22:50:15 +0100
commitb59f37bc0a485113d0500c71bf179781f509e61f (patch)
tree17d32bebb4b8e11540dddb9640d094bbebd1e1a4 /src
parentcf2d171cccfbc5627ce9957cc8dd63272a16e0d3 (diff)
db/simple/Directory: close the Database in destructor
Fixes assertion failure.
Diffstat (limited to 'src')
-rw-r--r--src/db/plugins/simple/Directory.cxx5
1 files changed, 5 insertions, 0 deletions
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());
}