mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 16:43:03 +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:
parent
90ef56ae16
commit
da55f0ab14
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user