Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destructor of ACE_Sig_Handler removes registered signal handlers of all objects #2304

Open
amartin755 opened this issue Dec 10, 2024 · 0 comments

Comments

@amartin755
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant