ACE_TAO
ACE_TAO copied to clipboard
Destructor of ACE_Sig_Handler removes registered signal handlers of all objects
Version
ACE-8.0.2
Description
According to this code, all registered signals are removed because ACE_Sig_Handler::signal_handlers_ is static:
ACE_Sig_Handler::~ACE_Sig_Handler ()
{
for (int s = 1; s < ACE_NSIG; ++s)
if (ACE_Sig_Handler::signal_handlers_[s])
ACE_Sig_Handler::remove_handler_i (s);
}
When you have two objects of ACE_Sig_Handler, then the destructor affects signal handlers that were registered via the other object.
This brings me to the question, whether this class must be used as a singleton.
Do i understand the code correctly? Is this the intended use?