/indra/llcommon/llcommon.cpp

https://bitbucket.org/lindenlab/viewer-beta/ · C++ · 64 lines · 27 code · 6 blank · 31 comment · 2 complexity · c78a26a08db8e5d21fe0db93d84bae77 MD5 · raw file

  1. /**
  2. * @file llcommon.cpp
  3. *
  4. * $LicenseInfo:firstyear=2006&license=viewerlgpl$
  5. * Second Life Viewer Source Code
  6. * Copyright (C) 2010, Linden Research, Inc.
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation;
  11. * version 2.1 of the License only.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  23. * $/LicenseInfo$
  24. */
  25. #include "linden_common.h"
  26. #include "llcommon.h"
  27. #include "llmemory.h"
  28. #include "llthread.h"
  29. //static
  30. BOOL LLCommon::sAprInitialized = FALSE;
  31. //static
  32. void LLCommon::initClass()
  33. {
  34. LLMemory::initClass();
  35. if (!sAprInitialized)
  36. {
  37. ll_init_apr();
  38. sAprInitialized = TRUE;
  39. }
  40. LLTimer::initClass();
  41. LLThreadSafeRefCount::initThreadSafeRefCount();
  42. // LLWorkerThread::initClass();
  43. // LLFrameCallbackManager::initClass();
  44. }
  45. //static
  46. void LLCommon::cleanupClass()
  47. {
  48. // LLFrameCallbackManager::cleanupClass();
  49. // LLWorkerThread::cleanupClass();
  50. LLThreadSafeRefCount::cleanupThreadSafeRefCount();
  51. LLTimer::cleanupClass();
  52. if (sAprInitialized)
  53. {
  54. ll_cleanup_apr();
  55. sAprInitialized = FALSE;
  56. }
  57. LLMemory::cleanupClass();
  58. }