CBaseGloabl.cpp 440 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #include "pch.h"
  2. #include "CBaseGloabl.h"
  3. CBaseGloabl::CBaseGloabl()
  4. {
  5. m_Ref = 0;
  6. m_Networ = new CNetwork();
  7. }
  8. CBaseGloabl::~CBaseGloabl(void)
  9. {
  10. if (m_Networ)
  11. {
  12. delete m_Networ;
  13. m_Networ = NULL;
  14. }
  15. }
  16. IBaseCurl* CBaseGloabl::GetBaseCurlInstance()
  17. {
  18. return m_Networ;
  19. }
  20. INT CBaseGloabl::AddRef()
  21. {
  22. return ++m_Ref;
  23. }
  24. INT CBaseGloabl::Release()
  25. {
  26. --m_Ref;
  27. if (m_Ref == 0)
  28. {
  29. delete this;
  30. return 0;
  31. }
  32. return m_Ref;
  33. }