From 0e9b3d3947b77de3375165f3fc96ecaa0686713e Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Tue, 20 Nov 2012 19:33:16 +0000 Subject: Tue Nov 20 19:32:42 UTC 2012 Johnny Willemsen * tao/Utils/PolicyList_Destroyer.cpp: Call index also in the try/catch scope because it can also throw an exception --- TAO/tao/Utils/PolicyList_Destroyer.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'TAO/tao/Utils') diff --git a/TAO/tao/Utils/PolicyList_Destroyer.cpp b/TAO/tao/Utils/PolicyList_Destroyer.cpp index adc8436e240..5e15e55e325 100644 --- a/TAO/tao/Utils/PolicyList_Destroyer.cpp +++ b/TAO/tao/Utils/PolicyList_Destroyer.cpp @@ -10,24 +10,20 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL TAO::Utils::PolicyList_Destroyer::~PolicyList_Destroyer() throw () { - for (CORBA::ULong i = 0; i != length(); ++i) { CORBA::Policy_ptr policy = (*this)[i]; - if (CORBA::is_nil (policy)) - { - continue; - } - - try + if (!CORBA::is_nil (policy)) { - policy->destroy (); + try + { + policy->destroy (); + (*this)[i] = CORBA::Policy::_nil(); + } + catch (...) + { + } } - catch (...) - { - } - - (*this)[i] = CORBA::Policy::_nil(); } } -- cgit v1.2.1