From e0b216d576649305ecb65b8d4481717ef1840b02 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 24 Jan 2012 23:17:26 +0000 Subject: [PATCH] HooksManager: do not propagate hooks runtime exception --- src/hooks_manager.cc | 8 +++++++- src/window.cc | 6 +----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/hooks_manager.cc b/src/hooks_manager.cc index 0a9ef1ce..239e429d 100644 --- a/src/hooks_manager.cc +++ b/src/hooks_manager.cc @@ -17,7 +17,13 @@ void HooksManager::run_hook(const std::string& hook_name, return; for (auto& hook : hook_list_it->second) - hook(param, context); + { + try + { + hook(param, context); + } + catch (runtime_error&) {} + } } } diff --git a/src/window.cc b/src/window.cc index f123f6b5..ff583ea3 100644 --- a/src/window.cc +++ b/src/window.cc @@ -464,11 +464,7 @@ IncrementalInserter::~IncrementalInserter() move_cursor(DisplayCoord(0, -1)); m_window.push_selections(); - try - { - m_window.hooks_manager().run_hook("InsertEnd", "", Context(m_window)); - } - catch (runtime_error& e) {} + m_window.hooks_manager().run_hook("InsertEnd", "", Context(m_window)); m_window.pop_selections(); assert(m_window.m_current_inserter == this);