ClientManager: tweak on input event lambda

This commit is contained in:
Maxime Coste 2012-11-06 13:37:18 +01:00
parent d347223e42
commit 3471d795c9

View File

@ -12,7 +12,7 @@ void ClientManager::create_client(std::unique_ptr<UserInterface>&& ui,
InputHandler* input_handler = m_clients.back().input_handler.get();
Context* context = m_clients.back().context.get();
EventManager::instance().watch(event_fd, [=](int) {
EventManager::instance().watch(event_fd, [input_handler, context, this](int fd) {
try
{
input_handler->handle_available_inputs(*context);
@ -24,8 +24,8 @@ void ClientManager::create_client(std::unique_ptr<UserInterface>&& ui,
}
catch (Kakoune::client_removed&)
{
EventManager::instance().unwatch(event_fd);
close(event_fd);
EventManager::instance().unwatch(fd);
close(fd);
}
ClientManager::instance().redraw_clients();
});