db/simple/Directory: close the Database in destructor

Fixes assertion failure.
This commit is contained in:
Max Kellermann 2019-02-20 22:50:15 +01:00
parent cf2d171ccc
commit b59f37bc0a
2 changed files with 6 additions and 0 deletions

1
NEWS
View File

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

View File

@ -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());
}