// RuntimeForStatic base library | C+- (SysRoutine) | Author: Sergei Y.Kitáev
#include "Precompiled.h"
#include "SharedIncludes.h"
namespace RuntimeForStatic {
//==================================================================================================

$COMAuto::$COMAuto($A, $PIUnknown volatile* pInterfacePointer $p_optional )
{
   $$VERIFY_POINTER_ARG( pInterfacePointer );
   _PInterfacePointer_ = pInterfacePointer;
   ValidateDisposable($$);
}

//==================================================================================================

void $COMAuto::DoDispose($CI_REF)
{
   Free($ci);
}

void $COMAuto::ResetSuperstructure()
{
   _PInterfacePointer_ = nullptr;
}

//==================================================================================================

void $COMAuto::Free($O)
{
   if ( IsValidDisposable )
   {
      $COMInterface::ResetAndRelease($$, _PInterfacePointer_ );
      ResetSuperstructure();
      InvalidateDisposable();
   }
}

void $COMAuto::Neutralize()
{
   InvalidateDisposable();
}

//==================================================================================================
} // RuntimeForStatic
