8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 06:03:02 +01:00

Avoid unnecessary operations in the destructor. This also prevents possible hangs in Classic builds.

This commit is contained in:
Dmitry Yemanov 2020-01-12 10:38:31 +03:00
parent 675e7e0171
commit a9923c92af

View File

@ -133,13 +133,20 @@ MonitoringData::MonitoringData(const Database* dbb)
MonitoringData::~MonitoringData()
{
Guard guard(this);
m_sharedMemory->mutexLock();
try
{
if (m_sharedMemory->getHeader() &&
m_sharedMemory->getHeader()->used == alignOffset(sizeof(Header)))
{
m_sharedMemory->removeMapFile();
}
}
catch (const Exception&)
{} // no-op
m_sharedMemory->mutexUnlock();
}