BsCoreObjectCore.cpp 562 B

12345678910111213141516171819202122232425
  1. #include "BsCoreObjectCore.h"
  2. #include "BsCoreThread.h"
  3. namespace BansheeEngine
  4. {
  5. CoreObjectCore::CoreObjectCore()
  6. :mCoreDirtyFlags(0xFFFFFFFF), mIsDestroyed(false)
  7. { }
  8. CoreObjectCore::~CoreObjectCore()
  9. {
  10. // This should only trigger for objects created directly by core thread.
  11. // If you are not sure this will get called by the core thread, make sure
  12. // to destroy() the object manually before it goes out of scope.
  13. if (!mIsDestroyed)
  14. destroy();
  15. }
  16. void CoreObjectCore::destroy()
  17. {
  18. throwIfNotCoreThread();
  19. mIsDestroyed = true;
  20. }
  21. }