summaryrefslogtreecommitdiff
path: root/TAO/tao/Utils/PolicyList_Destroyer.cpp
blob: f4e06fcbc1c042cc2d2e912ae99c4dc940aa6b82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "tao/Utils/PolicyList_Destroyer.h"

#if !defined (__ACE_INLINE__)
# include "tao/Utils/PolicyList_Destroyer.inl"
#endif /* __ACE_INLINE__ */

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))
        {
          try
            {
              policy->destroy ();
              (*this)[i] = CORBA::Policy::_nil();
            }
          catch (...)
            {
            }
        }
    }
}

TAO_END_VERSIONED_NAMESPACE_DECL