Windows2003-3790/admin/cys/lib/init.cpp

31 lines
558 B
C++
Raw Normal View History

2001-01-01 00:00:00 +01:00
// Copyright (c) 2002 Microsoft Corporation
//
// File: init.cpp
//
// Synopsis: Defines an initialization guard
// to ensure that all resources are freed
//
// History: 03/26/2002 JeffJon Created
#include "pch.h"
#include "init.h"
#include "state.h"
unsigned CYSInitializationGuard::counter = 0;
CYSInitializationGuard::CYSInitializationGuard()
{
counter++;
}
CYSInitializationGuard::~CYSInitializationGuard()
{
if (--counter == 0)
{
// cleanup the State
State::Destroy();
}
}