RioEngine
0.1
My first attempt to create a 3D WYSIWYG Game Engine
|
#include <cautoreleasepool.h>
Public Member Functions | |
CAutoreleasePool (void) | |
virtual void | addObject (CObject *obj) |
virtual void | drain () |
~CAutoreleasePool (void) | |
![]() | |
CObject () | |
CObject (const CObject &object) | |
CObject & | operator= (const CObject &object) |
CObject * | retain () |
unsigned int | release () const |
CObject * | autorelease () |
unsigned int | retainCount () const |
bool | isValidCObject () const |
virtual | ~CObject () |
Static Public Member Functions | |
static void | log () |
static void | releasePools () |
![]() | |
static void | safeRetain (void *pointer) |
template<class T > | |
static void | safeRelease (T *pointer) |
template<class T > | |
static void | safeReleaseArray (T *array) |
static void | safeRelease (const char *pointer) |
Protected Attributes | |
std::vector< CObject * > * | m_localPool |
Static Protected Attributes | |
static std::vector< std::vector< CObject * > * > * | m_pools |
Additional Inherited Members | |
![]() | |
virtual void | copyValuesFromObject (const CObject &object) |
This is my own version of the NSAutoreleasePool class. An autorelease pool stores objects that are sent a release message when the pool itself is drained. I haven't take a look at the original NSAutoreleasePool code, but it seems that I managed to make this class very reliable on my own. If you analize the engine for memory leaks you will hardly find any. Let me know if you ever find one!
Definition at line 47 of file cautoreleasepool.h.
CAutoreleasePool::CAutoreleasePool | ( | void | ) |
Definition at line 40 of file cautoreleasepool.cpp.
CAutoreleasePool::~CAutoreleasePool | ( | void | ) |
Definition at line 104 of file cautoreleasepool.cpp.
|
virtual |
Adds the object to the current pool.
Definition at line 48 of file cautoreleasepool.cpp.
|
virtual |
Drains the current pool.
Definition at line 56 of file cautoreleasepool.cpp.
|
static |
Prints all the objects that are pending to be released. Useful when debugging.
Definition at line 72 of file cautoreleasepool.cpp.
|
static |
You should always call this static method before closing the application.
Definition at line 98 of file cautoreleasepool.cpp.
|
protected |
Definition at line 77 of file cautoreleasepool.h.
|
staticprotected |
Definition at line 76 of file cautoreleasepool.h.