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

Protection from double deallocation of queued buffers, thanks to Vlad. Usually this should not happen, but possible after error thrown during commit (while journal/replica flushing).

This commit is contained in:
Dmitry Yemanov 2023-09-05 18:35:05 +03:00
parent 90ef56ae16
commit da55f0ab14

View File

@ -187,11 +187,9 @@ Manager::Manager(const string& dbId,
Manager::~Manager()
{
fb_assert(m_shutdown);
fb_assert(m_queue.isEmpty());
fb_assert(m_replicas.isEmpty());
for (auto buffer : m_queue)
delete buffer;
for (auto buffer : m_buffers)
delete buffer;
}
@ -208,6 +206,13 @@ void Manager::shutdown()
MutexLockGuard guard(m_queueMutex, FB_FUNCTION);
// Clear the processing queue
for (auto buffer : m_queue)
releaseBuffer(buffer);
m_queue.clear();
// Detach from synchronous replicas
for (auto iter : m_replicas)