diff options
Diffstat (limited to 'ace/Timer_Heap.cpp')
-rw-r--r-- | ace/Timer_Heap.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ace/Timer_Heap.cpp b/ace/Timer_Heap.cpp index 059f9f8570b..60e23aeaba7 100644 --- a/ace/Timer_Heap.cpp +++ b/ace/Timer_Heap.cpp @@ -512,11 +512,14 @@ ACE_Timer_Heap::cancel (ACE_Event_Handler *handler) if (this->heap_[i]->handler_ == handler) { ACE_Timer_Node *temp = this->remove (i); - // Call the close hook. - temp->handler_->handle_close (ACE_INVALID_HANDLE, - ACE_Event_Handler::TIMER_MASK); - this->free_node (temp); + number_of_cancellations++; + + if (number_of_cancellations == 1) + // Call the close hook. + temp->handler_->handle_close (ACE_INVALID_HANDLE, + ACE_Event_Handler::TIMER_MASK); + this->free_node (temp); } else i++; |