diff options
-rw-r--r-- | TAO/ChangeLog | 18 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.cpp | 28 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp | 10 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Log/Log_i.cpp | 1 |
4 files changed, 42 insertions, 15 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 6c073b25a2b..456ee7b8a6c 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,21 @@ +Tue Jun 13 14:56:01 UTC 2006 J.T. Conklin <jtc@acorntoolworks.com> + + * orbsvcs/orbsvcs/Log/Log_i.cpp: + + Don't close the LogRecordStore in the TAO_Log_i destructor, if + the log channel was destroyed, it will be a dangling reference. + The LogStore should be responsible for opening and closing its + LogRecordStores. + + * orbsvcs/orbsvcs/Log/Hash_LogStore.cpp (remove): + + Obtain and delete LogRecordStore when unbinding from map. + Avoids leak. + + * orbsvcs/orbsvcs/Log/Hash_LogRecordStore.cpp (query_i): + + Re-indent to match coding conventions. + Tue Jun 13 13:51:11 UTC 2006 Adam Mitz <mitza@ociweb.com> * tests/Bug_2494_Regression/client.cpp: diff --git a/TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.cpp b/TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.cpp index 0ac462cf296..aeee88a88df 100644 --- a/TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.cpp +++ b/TAO/orbsvcs/orbsvcs/Log/Hash_LogRecordStore.cpp @@ -388,23 +388,25 @@ TAO_Hash_LogRecordStore::query_i (const char *constraint, // Does it match the constraint? if (interpreter.evaluate (evaluator) == 1) - { - if (TAO_debug_level > 0) + { + if (TAO_debug_level > 0) + { #if defined (ACE_LACKS_LONGLONG_T) - ACE_DEBUG ((LM_DEBUG,"Matched constraint! d = %d, Time = %d\n", - ACE_U64_TO_U32 (iter->item ().id), - ACE_U64_TO_U32 (iter->item ().time))); + ACE_DEBUG ((LM_DEBUG,"Matched constraint! d = %d, Time = %d\n", + ACE_U64_TO_U32 (iter->item ().id), + ACE_U64_TO_U32 (iter->item ().time))); #else - ACE_DEBUG ((LM_DEBUG,"Matched constraint! d = %Q, Time = %Q\n", - iter->item ().id, - iter->item ().time)); + ACE_DEBUG ((LM_DEBUG,"Matched constraint! d = %Q, Time = %Q\n", + iter->item ().id, + iter->item ().time)); #endif - - (*rec_list)[count] = iter->item (); - // copy the log record. - count++; - } + } + + (*rec_list)[count] = iter->item (); + // copy the log record. + count++; + } } rec_list->length (count); diff --git a/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp b/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp index 16a3d50b9c8..3d4ab499e89 100644 --- a/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp +++ b/TAO/orbsvcs/orbsvcs/Log/Hash_LogStore.cpp @@ -154,7 +154,15 @@ TAO_Hash_LogStore::remove (DsLogAdmin::LogId id CORBA::INTERNAL ()); ACE_CHECK_RETURN (-1); - return this->hash_map_.unbind (id); + TAO_Hash_LogRecordStore* recordstore; + + int retval = this->hash_map_.unbind (id, recordstore); + if (retval == 0) + { + delete recordstore; + } + + return retval; } diff --git a/TAO/orbsvcs/orbsvcs/Log/Log_i.cpp b/TAO/orbsvcs/orbsvcs/Log/Log_i.cpp index f652e446c5e..263ef5d7ebc 100644 --- a/TAO/orbsvcs/orbsvcs/Log/Log_i.cpp +++ b/TAO/orbsvcs/orbsvcs/Log/Log_i.cpp @@ -106,7 +106,6 @@ TAO_Log_i::init (ACE_ENV_SINGLE_ARG_DECL) TAO_Log_i::~TAO_Log_i (void) { - recordstore_->close (); } DsLogAdmin::LogMgr_ptr |