summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog-98a6
-rw-r--r--ace/Module.cpp16
-rw-r--r--ace/Svc_Handler.cpp5
3 files changed, 22 insertions, 5 deletions
diff --git a/ChangeLog-98a b/ChangeLog-98a
index 9109a4c9832..7eb5442f8e4 100644
--- a/ChangeLog-98a
+++ b/ChangeLog-98a
@@ -1,5 +1,11 @@
Tue Mar 10 15:07:00 1998 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+ * ace/Svc_Handler.cpp,
+ ace/Module.cpp:
+ Fixed some problems where Svc_Handlers in Modules were being
+ deleted prematurely. Thanks to Steve Coy <stevec@magna.com.au>
+ for reporting this.
+
* ace/Reactor.h (ACE_Reactor): Added a "reset_event_loop" method
so that it's possible to reset the loop again once the
end_event_loop() method is called. Thanks to Eric Hopper
diff --git a/ace/Module.cpp b/ace/Module.cpp
index 93fe1d8b84a..a65efe1e2e2 100644
--- a/ace/Module.cpp
+++ b/ace/Module.cpp
@@ -30,9 +30,14 @@ ACE_Module<ACE_SYNCH_USE>::writer (ACE_Task<ACE_SYNCH_USE> *q,
this->close_i (1, flags);
this->q_pair_[1] = q;
+
if (q != 0)
- ACE_CLR_BITS (q->flags_, ACE_Task_Flags::ACE_READER);
-
+ {
+ ACE_CLR_BITS (q->flags_, ACE_Task_Flags::ACE_READER);
+ // Set the q's module pointer to point to us.
+ q->mod_ = this;
+ }
+
// Don't allow the caller to change the reader status.
ACE_SET_BITS (flags_, (flags & M_DELETE_WRITER));
}
@@ -47,8 +52,13 @@ ACE_Module<ACE_SYNCH_USE>::reader (ACE_Task<ACE_SYNCH_USE> *q,
this->close_i (0, flags);
this->q_pair_[0] = q;
+
if (q != 0)
- ACE_SET_BITS (q->flags_, ACE_Task_Flags::ACE_READER);
+ {
+ ACE_SET_BITS (q->flags_, ACE_Task_Flags::ACE_READER);
+ // Set the q's module pointer to point to us.
+ q->mod_ = this;
+ }
// don't allow the caller to change the reader status
ACE_SET_BITS (flags_, (flags & M_DELETE_READER));
diff --git a/ace/Svc_Handler.cpp b/ace/Svc_Handler.cpp
index f461b9081bc..b5d7621b461 100644
--- a/ace/Svc_Handler.cpp
+++ b/ace/Svc_Handler.cpp
@@ -31,8 +31,9 @@ ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::destroy (void)
{
ACE_TRACE ("ACE_Svc_Handler<PR_ST_2, ACE_SYNCH_USE>::destroy");
- // Only delete ourselves if we've been allocated dynamically.
- if (this->dynamic_ && this->closing_ == 0)
+ // Only delete ourselves if we're not owned by a module and have
+ // been allocated dynamically.
+ if (this->mod_ == 0 && this->dynamic_ && this->closing_ == 0)
// Will call the destructor, which automatically calls <shutdown>.
// Note that if we are *not* allocated dynamically then the
// destructor will call <shutdown> automatically when it gets run