Avoid possible access to an invalid, being deleted buffer list.

This commit is contained in:
Maxime Coste 2016-07-04 19:20:22 +01:00
parent ca7f647562
commit 469eb6ec44

View File

@ -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();
}