CmCoreGpuObject.cpp 540 B

12345678910111213141516171819202122232425262728
  1. #include "CmCoreGpuObject.h"
  2. #include "CmRenderSystem.h"
  3. #include "CmDebug.h"
  4. namespace CamelotEngine
  5. {
  6. CoreGpuObject::CoreGpuObject()
  7. :mDestroyed(false)
  8. { }
  9. CoreGpuObject::~CoreGpuObject()
  10. {
  11. if(!mDestroyed)
  12. {
  13. LOGWRN("Destructor called but object is not destroyed. Object will leak.")
  14. }
  15. }
  16. void CoreGpuObject::destroy()
  17. {
  18. RenderSystem::instancePtr()->queueCommand(boost::bind(&CoreGpuObject::destroy_internal, this));
  19. }
  20. void CoreGpuObject::destroy_internal()
  21. {
  22. mDestroyed = true;
  23. }
  24. }