1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-05 22:59:29 +02:00

Do debug check for closing of DB before Project destruction safely...

... It wasn't safe, on some platforms, because the sequence of destruction
of ProjectFileIO and ConnectionPtr is unspecified.  It is safer that
ConnectionPtr just checks itself, not that ProjectFileIO fetches it again.
This commit is contained in:
Paul Licameli 2020-07-23 11:06:50 -04:00
parent 676af8ce38
commit 5bc2cb991f
2 changed files with 4 additions and 2 deletions

View File

@ -298,7 +298,10 @@ int DBConnection::CheckpointHook(void *data, sqlite3 *db, const char *schema, in
return SQLITE_OK;
}
ConnectionPtr::~ConnectionPtr() = default;
ConnectionPtr::~ConnectionPtr()
{
wxASSERT_MSG(mpConnection, wxT("Project file was not closed at shutdown"));
}
static const AudacityProject::AttachedObjects::RegisteredFactory
sConnectionPtrKey{

View File

@ -254,7 +254,6 @@ ProjectFileIO::ProjectFileIO(AudacityProject &project)
ProjectFileIO::~ProjectFileIO()
{
wxASSERT_MSG(!CurrConn(), wxT("Project file was not closed at shutdown"));
}
sqlite3 *ProjectFileIO::DB()