Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
558 B

  1. // Copyright (c) 2002 Microsoft Corporation
  2. //
  3. // File: init.cpp
  4. //
  5. // Synopsis: Defines an initialization guard
  6. // to ensure that all resources are freed
  7. //
  8. // History: 03/26/2002 JeffJon Created
  9. #include "pch.h"
  10. #include "init.h"
  11. #include "state.h"
  12. unsigned CYSInitializationGuard::counter = 0;
  13. CYSInitializationGuard::CYSInitializationGuard()
  14. {
  15. counter++;
  16. }
  17. CYSInitializationGuard::~CYSInitializationGuard()
  18. {
  19. if (--counter == 0)
  20. {
  21. // cleanup the State
  22. State::Destroy();
  23. }
  24. }