HooksManager: do not propagate hooks runtime exception

This commit is contained in:
Maxime Coste 2012-01-24 23:17:26 +00:00
parent 1fd8ec8bfd
commit e0b216d576
2 changed files with 8 additions and 6 deletions

View File

@ -17,7 +17,13 @@ void HooksManager::run_hook(const std::string& hook_name,
return; return;
for (auto& hook : hook_list_it->second) for (auto& hook : hook_list_it->second)
hook(param, context); {
try
{
hook(param, context);
}
catch (runtime_error&) {}
}
} }
} }

View File

@ -464,11 +464,7 @@ IncrementalInserter::~IncrementalInserter()
move_cursor(DisplayCoord(0, -1)); move_cursor(DisplayCoord(0, -1));
m_window.push_selections(); m_window.push_selections();
try m_window.hooks_manager().run_hook("InsertEnd", "", Context(m_window));
{
m_window.hooks_manager().run_hook("InsertEnd", "", Context(m_window));
}
catch (runtime_error& e) {}
m_window.pop_selections(); m_window.pop_selections();
assert(m_window.m_current_inserter == this); assert(m_window.m_current_inserter == this);