mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-29 09:57:38 +00:00
fixed a potential segfault in generic_event
This commit is contained in:
parent
62e503cac0
commit
7ab4967f1d
@ -42,7 +42,7 @@ bool generic_event::attach_handler(observer* obs){
|
||||
handler_attached = true;
|
||||
}
|
||||
}
|
||||
catch (std::exception&){
|
||||
catch (...){
|
||||
change_handler_ = false;
|
||||
throw;
|
||||
}
|
||||
@ -68,7 +68,7 @@ bool generic_event::detach_handler(observer* obs){
|
||||
handler_detached = true;
|
||||
}
|
||||
}
|
||||
catch (std::exception&){
|
||||
catch (...){
|
||||
change_handler_ = false;
|
||||
throw;
|
||||
}
|
||||
@ -87,7 +87,7 @@ void generic_event::notify_observers(){
|
||||
(*it)->handle_generic_event(name_);
|
||||
}
|
||||
}
|
||||
catch (std::exception&){
|
||||
catch (...){
|
||||
//reset the flag if event handlers throw exceptions and don't catch them
|
||||
notify_active_ = false;
|
||||
throw;
|
||||
|
Loading…
x
Reference in New Issue
Block a user