summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2005-12-13 09:25:49 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2005-12-13 09:25:49 +0000
commit51a1d12d16f429c7add1796c22c1731414dc5afe (patch)
tree8103ac08c362115bddac10b8b9f044c99b91c743
parent8b58553f9fa3595f09a05d6d705a963b9117ce5b (diff)
downloadATCD-51a1d12d16f429c7add1796c22c1731414dc5afe.tar.gz
ChangeLogTag: Tue Dec 13 09:25:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--TAO/orbsvcs/orbsvcs/Shutdown_Utilities.cpp16
-rw-r--r--TAO/orbsvcs/orbsvcs/Shutdown_Utilities.h1
2 files changed, 14 insertions, 3 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.cpp b/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.cpp
index ed2f37b7f13..45488574da3 100644
--- a/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.cpp
+++ b/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.cpp
@@ -40,7 +40,7 @@ void
Service_Shutdown::set_signals (ACE_Sig_Set& which_signals)
{
// iterate over all the signals in which_signals and register them...
- int did_register = 0;
+ bool did_register = false;
for (int i = 1; i < ACE_NSIG; ++i)
{
if (which_signals.is_member (i))
@@ -59,7 +59,12 @@ Service_Shutdown::set_signals (ACE_Sig_Set& which_signals)
}
}
else
- did_register = 1;
+ {
+ // Store that we have registered for this signal
+ // we have to unregister later for just these signals
+ this->registered_signals_.sig_add (i);
+ did_register = true;
+ }
}
}
if (! did_register)
@@ -72,7 +77,12 @@ Service_Shutdown::set_signals (ACE_Sig_Set& which_signals)
Service_Shutdown::~Service_Shutdown ()
{
for (int i = 1; i < ACE_NSIG; ++i)
- this->shutdown_.remove_handler(i);
+ {
+ if (this->registered_signals_.is_member (i))
+ {
+ this->shutdown_.remove_handler(i);
+ }
+ }
}
int
diff --git a/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.h b/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.h
index 78f52a09663..9d4983ffaaf 100644
--- a/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.h
+++ b/TAO/orbsvcs/orbsvcs/Shutdown_Utilities.h
@@ -60,6 +60,7 @@ public:
protected:
Shutdown_Functor& functor_;
ACE_Sig_Handler shutdown_;
+ ACE_Sig_Set registered_signals_;
};
TAO_END_VERSIONED_NAMESPACE_DECL