diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-03-09 21:38:26 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-03-09 21:38:26 +0000 |
commit | f31385201971af1e40ed5cce88cdf42af788d4e7 (patch) | |
tree | f3ceb13fae1b8ce1da8976318a7c6fd186128914 /TAO/examples | |
parent | 914c652f046c10636096594fbe77b69fc3feff0b (diff) | |
download | ATCD-f31385201971af1e40ed5cce88cdf42af788d4e7.tar.gz |
Fixed crash when Naming Service wasn't resolved, and also fixed some
memory leaks.
Diffstat (limited to 'TAO/examples')
-rw-r--r-- | TAO/examples/Quoter/server.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/TAO/examples/Quoter/server.cpp b/TAO/examples/Quoter/server.cpp index 3ee1ae34d18..a1ff917f3ed 100644 --- a/TAO/examples/Quoter/server.cpp +++ b/TAO/examples/Quoter/server.cpp @@ -137,7 +137,7 @@ Quoter_Server::init (int argc, } ACE_CATCHANY { - ACE_ERROR ((LM_ERROR, "Quote_Server::init - %s", exception_message)); + ACE_ERROR ((LM_ERROR, "Quote_Server::init - %s\n", exception_message)); ACE_TRY_ENV.print_exception ("SYS_EX"); ACE_RETHROW; } @@ -229,11 +229,13 @@ Quoter_Server::~Quoter_Server (void) factory_name.length (2); factory_name[0].id = CORBA::string_dup ("IDL_Quoter"); factory_name[1].id = CORBA::string_dup ("Quoter_Factory"); - this->namingContext_var_->unbind (factory_name, ACE_TRY_ENV); + if (this->namingContext_var_.ptr () != 0) + this->namingContext_var_->unbind (factory_name, ACE_TRY_ENV); ACE_TRY_CHECK; factory_name.length (1); - this->namingContext_var_->unbind (factory_name, ACE_TRY_ENV); + if (this->namingContext_var_.ptr () != 0) + this->namingContext_var_->unbind (factory_name, ACE_TRY_ENV); ACE_TRY_CHECK; } ACE_CATCHANY @@ -242,6 +244,9 @@ Quoter_Server::~Quoter_Server (void) ACE_TRY_ENV.print_exception ("~Quoter_Server"); } ACE_ENDTRY; + + delete [] this->argv_; + delete this->quoter_Factory_i_ptr_; } int |