summaryrefslogtreecommitdiff
path: root/ACE/ace/Dev_Poll_Reactor.cpp
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2014-09-16 18:11:56 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2014-09-16 18:11:56 +0000
commit37b61d612f24c4015252996a58d040eb7843dd76 (patch)
tree8dc2eee3b6416764385bda5a4aa5c59ca0ddcb41 /ACE/ace/Dev_Poll_Reactor.cpp
parentbc97d492399217f00fbd94ad76f1f6d81433186b (diff)
downloadATCD-37b61d612f24c4015252996a58d040eb7843dd76.tar.gz
Tue Sep 16 18:11:58 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
* ace/Dev_Poll_Reactor.cpp: * ace/Reactor.h: * ace/Select_Reactor_T.cpp: * ace/WFMO_Reactor.inl: When using ACE_Event_Handler_var together with reference counting it is easy to pass the var.handler() to the cancel_timer() operation of the reactor to just cancel all timers at shutdown. But, when the application specific initialization fails which leads to the fact that the var contains a nullptr, this leads to a crash. Updated all cancel_timer operations to also check if a valid event handler pointer has been passed. If not, we just return 0 * tests/MT_Reactor_Timer_Test.cpp: Added test for use case mentioned above
Diffstat (limited to 'ACE/ace/Dev_Poll_Reactor.cpp')
-rw-r--r--ACE/ace/Dev_Poll_Reactor.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/ACE/ace/Dev_Poll_Reactor.cpp b/ACE/ace/Dev_Poll_Reactor.cpp
index a9adbdd460d..c65fecbebb3 100644
--- a/ACE/ace/Dev_Poll_Reactor.cpp
+++ b/ACE/ace/Dev_Poll_Reactor.cpp
@@ -1961,17 +1961,17 @@ ACE_Dev_Poll_Reactor::reset_timer_interval (long timer_id,
}
int
-ACE_Dev_Poll_Reactor::cancel_timer (ACE_Event_Handler *event_handler,
+ACE_Dev_Poll_Reactor::cancel_timer (ACE_Event_Handler *handler,
int dont_call_handle_close)
{
ACE_TRACE ("ACE_Dev_Poll_Reactor::cancel_timer");
// Don't bother waking the poll - the worse that will happen is it will
// wake up for a timer that doesn't exist then go back to waiting.
- return (this->timer_queue_ == 0
- ? 0
- : this->timer_queue_->cancel (event_handler,
- dont_call_handle_close));
+ if ((this->timer_queue_ != 0) && (handler != 0))
+ return this->timer_queue_->cancel (handler, dont_call_handle_close);
+ else
+ return 0;
}
int