diff options
author | Phil Mesnier <mesnier_p@ociweb.com> | 2014-01-18 00:18:39 +0000 |
---|---|---|
committer | Phil Mesnier <mesnier_p@ociweb.com> | 2014-01-18 00:18:39 +0000 |
commit | 8c5cc52112dae844698ff898cd3a173ea01220bb (patch) | |
tree | c64fe20ac6b5ff45db133e931996c8a43930970b /TAO | |
parent | 83a3d01ba80d445d215d004ade2f71b02ea7a7c6 (diff) | |
download | ATCD-8c5cc52112dae844698ff898cd3a173ea01220bb.tar.gz |
Sat Jan 18 00:16:14 UTC 2014 Phil Mesnier <mesnier_p@ociweb.com>
* orbsvcs/DevGuideExamples/ImplRepo/run_test.pl:
Fix the order of termination of activator & locator.
* orbsvcs/ImplRepo_Service/LiveCheck.h:
* orbsvcs/ImplRepo_Service/LiveCheck.cpp:
Fix various valgrind reported errors including a memory leak
related to per-client activations and invalid memory access.
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/ChangeLog | 10 | ||||
-rwxr-xr-x | TAO/orbsvcs/DevGuideExamples/ImplRepo/run_test.pl | 12 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp | 35 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/LiveCheck.h | 2 |
4 files changed, 38 insertions, 21 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 66f4cc48d76..40603b66c3d 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,13 @@ +Sat Jan 18 00:16:14 UTC 2014 Phil Mesnier <mesnier_p@ociweb.com> + + * orbsvcs/DevGuideExamples/ImplRepo/run_test.pl: + Fix the order of termination of activator & locator. + + * orbsvcs/ImplRepo_Service/LiveCheck.h: + * orbsvcs/ImplRepo_Service/LiveCheck.cpp: + Fix various valgrind reported errors including a memory leak + related to per-client activations and invalid memory access. + Fri Jan 17 16:12:31 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl> * orbsvcs/orbsvcs/Log/Log_Constraint_Visitors.cpp: diff --git a/TAO/orbsvcs/DevGuideExamples/ImplRepo/run_test.pl b/TAO/orbsvcs/DevGuideExamples/ImplRepo/run_test.pl index ee1463141af..b3ce3cd907f 100755 --- a/TAO/orbsvcs/DevGuideExamples/ImplRepo/run_test.pl +++ b/TAO/orbsvcs/DevGuideExamples/ImplRepo/run_test.pl @@ -246,6 +246,12 @@ if ($SDN_status != 0) { exit 1; } +$ACT_status = $ACT->TerminateWaitKill ($act->ProcessStopWaitInterval()); + +if ($ACT_status != 0) { + print STDERR "ERROR: ImR_Activator returned $ACT_status\n"; + $status = 1; +} $IR_status = $IR->TerminateWaitKill ($imr->ProcessStopWaitInterval()); @@ -254,12 +260,6 @@ if ($IR_status != 0) { $status = 1; } -$ACT_status = $ACT->TerminateWaitKill ($act->ProcessStopWaitInterval()); - -if ($ACT_status != 0) { - print STDERR "ERROR: ImR_Activator returned $ACT_status\n"; - $status = 1; -} $imr->DeleteFile ($implrepo_ior); $act->DeleteFile ($implrepo_ior); diff --git a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp index e46ee0b2a61..ea1f1f5c60b 100644 --- a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp @@ -273,7 +273,10 @@ LiveEntry::status (LiveStatus l) } else { - this->owner_->remove_per_client_entry (this); + if (this->owner_->remove_per_client_entry (this)) + { + delete (this); + } } } @@ -480,8 +483,8 @@ PingReceiver::ping (void) ACE_TEXT ("(%P|%t) PingReceiver::ping received from %C\n"), this->entry_->server_name ())); } - this->entry_->status (LS_ALIVE); this->entry_->release_callback (); + this->entry_->status (LS_ALIVE); } PortableServer::ObjectId_var oid = this->poa_->servant_to_id (this); poa_->deactivate_object (oid.in()); @@ -510,8 +513,8 @@ PingReceiver::ping_excep (Messaging::ExceptionHolder * excep_holder) { if (this->entry_ != 0) { - this->entry_->status (LS_TRANSIENT); this->entry_->release_callback (); + this->entry_->status (LS_TRANSIENT); } break; } @@ -519,8 +522,8 @@ PingReceiver::ping_excep (Messaging::ExceptionHolder * excep_holder) { if (this->entry_ != 0) { - this->entry_->status (LS_DEAD); this->entry_->release_callback (); + this->entry_->status (LS_DEAD); } } } @@ -529,16 +532,16 @@ PingReceiver::ping_excep (Messaging::ExceptionHolder * excep_holder) { if (this->entry_ != 0) { - this->entry_->status (LS_TIMEDOUT); this->entry_->release_callback (); + this->entry_->status (LS_TIMEDOUT); } } catch (CORBA::Exception &) { if (this->entry_ != 0) { - this->entry_->status (LS_DEAD); this->entry_->release_callback (); + this->entry_->status (LS_DEAD); } } @@ -622,14 +625,17 @@ LiveCheck::LiveCheck () LiveCheck::~LiveCheck (void) { - while (this->entry_map_.current_size() > 0) + for (LiveEntryMap::iterator em (this->entry_map_); !em.done(); em++) + { + delete em->int_id_; + } + this->entry_map_.unbind_all(); + + for (PerClientStack::iterator pc (this->per_client_); !pc.done(); pc++) { - LiveEntryMap::iterator i (this->entry_map_); - LiveEntryMap::value_type *pair = 0; - i.next (pair); - this->entry_map_.unbind(pair); - delete pair->item(); + delete *pc; } + this->per_client_.reset (); } void @@ -725,6 +731,7 @@ LiveCheck::handle_timeout (const ACE_Time_Value &, if (status != LS_PING_AWAY && status != LS_TRANSIENT) { this->per_client_.remove (entry); + delete entry; } } } @@ -771,10 +778,10 @@ LiveCheck::remove_server (const char *server) delete entry; } -void +bool LiveCheck::remove_per_client_entry (LiveEntry *e) { - this->per_client_.remove (e); + return (this->per_client_.remove (e) == 0); } bool diff --git a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h index 01de6f6fd0a..466b36a7974 100644 --- a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h +++ b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h @@ -254,7 +254,7 @@ class Locator_Export LiveCheck : public ACE_Event_Handler void remove_server (const char *server); - void remove_per_client_entry (LiveEntry *entry); + bool remove_per_client_entry (LiveEntry *entry); bool add_listener (LiveListener *listener); |