diff --git a/src/buffer_manager.cc b/src/buffer_manager.cc index d6dc9ae0..e743bff0 100644 --- a/src/buffer_manager.cc +++ b/src/buffer_manager.cc @@ -18,6 +18,10 @@ struct name_not_unique : runtime_error BufferManager::~BufferManager() { + // Move buffers to m_buffer_trash to avoid running BufClose + // hook while clearing m_buffers + m_buffer_trash = std::move(m_buffers); + // Make sure not clients exists ClientManager::instance().clear(); }