BufferManager should outlive ClientManager in the end
If not, clients end up keeping references on a buffer while it it being deleted.
This commit is contained in:
parent
2df7b1f6da
commit
67849f2db7
|
@ -16,21 +16,13 @@ struct name_not_unique : runtime_error
|
|||
name_not_unique() : runtime_error("buffer name is already in use") {}
|
||||
};
|
||||
|
||||
BufferManager::BufferManager()
|
||||
{
|
||||
kak_assert(ClientManager::has_instance());
|
||||
}
|
||||
|
||||
BufferManager::~BufferManager()
|
||||
{
|
||||
kak_assert(ClientManager::has_instance());
|
||||
kak_assert(not ClientManager::has_instance());
|
||||
|
||||
// delete remaining buffers
|
||||
while (not m_buffers.empty())
|
||||
{
|
||||
ClientManager::instance().ensure_no_client_uses_buffer(*m_buffers.front().get());
|
||||
delete m_buffers.front().get();
|
||||
}
|
||||
}
|
||||
|
||||
void BufferManager::register_buffer(Buffer& buffer)
|
||||
|
|
|
@ -16,7 +16,6 @@ public:
|
|||
using BufferList = Vector<SafePtr<Buffer>>;
|
||||
using iterator = BufferList::const_iterator;
|
||||
|
||||
BufferManager();
|
||||
~BufferManager();
|
||||
|
||||
void register_buffer(Buffer& buffer);
|
||||
|
|
|
@ -463,8 +463,8 @@ int run_server(StringView session, StringView init_command,
|
|||
HighlighterRegistry highlighter_registry;
|
||||
DefinedHighlighters defined_highlighters;
|
||||
FaceRegistry face_registry;
|
||||
ClientManager client_manager;
|
||||
BufferManager buffer_manager;
|
||||
ClientManager client_manager;
|
||||
|
||||
register_options();
|
||||
register_env_vars();
|
||||
|
@ -590,8 +590,8 @@ int run_filter(StringView keystr, StringView commands, ConstArrayView<StringView
|
|||
ShellManager shell_manager;
|
||||
CommandManager command_manager;
|
||||
RegisterManager register_manager;
|
||||
ClientManager client_manager;
|
||||
BufferManager buffer_manager;
|
||||
ClientManager client_manager;
|
||||
|
||||
register_options();
|
||||
register_env_vars();
|
||||
|
|
Loading…
Reference in New Issue
Block a user