EventQueue.cpp 667 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include "stdafx.h"
  2. #include "EventQueue.h"
  3. #include "msgdef.h"
  4. #ifdef _DEBUG
  5. #define new DEBUG_NEW
  6. #undef THIS_FILE
  7. static char THIS_FILE[] = __FILE__;
  8. #endif
  9. CEventQueue::CEventQueue()
  10. {
  11. }
  12. CEventQueue::~CEventQueue()
  13. {
  14. Clear();
  15. }
  16. /************************************************************************/
  17. /*
  18. 函数:ClearEvent
  19. 描述:清除事件
  20. 参数:
  21. 返回:1成功,0失败
  22. */
  23. /************************************************************************/
  24. void CEventQueue::Clear()
  25. {
  26. CAutoLock autolock(&m_l);
  27. std::list<LPSEVENT>::iterator it = m_list.begin();
  28. for(;it != m_list.end();)
  29. {
  30. LPSEVENT lp = (*it);
  31. if(lp != NULL)
  32. delete lp;
  33. ++it;
  34. }
  35. m_list.clear();
  36. }