summaryrefslogtreecommitdiff
path: root/TAO/tao/ORB_Core_Auto_Ptr.cpp
blob: e3904b7661e191a7aa27b57cac63a26fe8837426 (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
29
30
// -*- C++ -*-
#include "tao/ORB_Core_Auto_Ptr.h"
#include "tao/ORB_Core.h"

#if !defined (__ACE_INLINE__)
# include "tao/ORB_Core_Auto_Ptr.inl"
#endif  /* !__ACE_INLINE */

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

TAO_ORB_Core_Auto_Ptr::~TAO_ORB_Core_Auto_Ptr ()
{
  if (this->get () != nullptr)
    {
      this->get ()->_decr_refcnt ();
    }
}

void
TAO_ORB_Core_Auto_Ptr::reset (TAO_ORB_Core *p)
{
  if (this->get () != p && this->get () != nullptr)
    {
      this->get ()->_decr_refcnt ();
    }

  this->p_ = p;
}

TAO_END_VERSIONED_NAMESPACE_DECL