You're breathtaking!
This commit is contained in:
25
Source/Engine/Core/Object.cpp
Normal file
25
Source/Engine/Core/Object.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright (c) 2012-2020 Wojciech Figat. All rights reserved.
|
||||
|
||||
#include "Object.h"
|
||||
#include "ObjectsRemovalService.h"
|
||||
|
||||
RemovableObject::~RemovableObject()
|
||||
{
|
||||
#if BUILD_DEBUG
|
||||
// Prevent removing object that is still reverenced by the removal service
|
||||
ASSERT(!ObjectsRemovalService::IsInPool(this));
|
||||
#endif
|
||||
}
|
||||
|
||||
void RemovableObject::DeleteObjectNow()
|
||||
{
|
||||
ObjectsRemovalService::Dereference(this);
|
||||
|
||||
OnDeleteObject();
|
||||
}
|
||||
|
||||
void RemovableObject::DeleteObject(float timeToLive, bool useGameTime)
|
||||
{
|
||||
// Add to deferred remove (or just update timeout but don't remove object here)
|
||||
ObjectsRemovalService::Add(this, timeToLive, useGameTime);
|
||||
}
|
||||
Reference in New Issue
Block a user