#include <CCAutoreleasePool.h>
Public Member Functions | |
AutoreleasePool () | |
@ More... | |
AutoreleasePool (const std::string &name) | |
Create an autorelease pool with specific name. More... | |
~AutoreleasePool () | |
void | addObject (Ref *object) |
Add a given object to this autorelease pool. More... | |
void | clear () |
Clear the autorelease pool. More... | |
bool | contains (Ref *object) const |
Checks whether the autorelease pool contains the specified object. More... | |
void | dump () |
Dump the objects that are put into the autorelease pool. More... | |
AutoreleasePool | ( | ) |
@
AutoreleasePool | ( | const std::string & | name | ) |
Create an autorelease pool with specific name.
This name is useful for debugging. Don't create an autorelease pool in heap, create it in stack.
@
~AutoreleasePool | ( | ) |
void addObject | ( | Ref * | object | ) |
Add a given object to this autorelease pool.
The same object may be added several times to an autorelease pool. When the pool is destructed, the object's Ref::release()
method will be called the same times as it was added.
object | The object to be added into the autorelease pool. |
void clear | ( | ) |
Clear the autorelease pool.
It will invoke each element's release()
function.
bool contains | ( | Ref * | object | ) | const |
Checks whether the autorelease pool contains the specified object.
object | The object to be checked. |
void dump | ( | ) |
Dump the objects that are put into the autorelease pool.
It is used for debugging.
The result will look like: Object pointer address object id reference count