My Project
|
when base object is created it has zero reference, and is usually added to auto release pool to be removed in the next frame. More...
#include <ObjectAutoReleasePool.h>
Public Member Functions | |
void | AddObject (CRefCounted *object) |
Add a given object to this pool. More... | |
void | clear () |
Clear the auto release pool. More... | |
bool | contains (CRefCounted *object) const |
Checks whether the pool contains the specified object. | |
void | dump () |
Dump the objects that are put into autorelease pool. More... | |
Static Public Member Functions | |
static CObjectAutoReleasePool * | GetInstance () |
static void | DestoryInstance () |
Static Protected Attributes | |
static CObjectAutoReleasePool * | s_singleInstance = nullptr |
when base object is created it has zero reference, and is usually added to auto release pool to be removed in the next frame.
when detach a base object from a node, the node is usually added to auto release pool as well, so that we may attach it again to another node before end of frame.
void ParaEngine::CObjectAutoReleasePool::AddObject | ( | CRefCounted * | object | ) |
Add a given object to this pool.
it will addref each time each function is called.
The same object may be added several times to the same pool; When the pool is destructed, the object's Release() method will be called for each time it was added.
void ParaEngine::CObjectAutoReleasePool::clear | ( | ) |
Clear the auto release pool.
Release() will be called for each time the managed object is added to the pool.
void ParaEngine::CObjectAutoReleasePool::dump | ( | ) |
Dump the objects that are put into autorelease pool.
It is used for debugging.
The result will look like: Object pointer address object id reference count