Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::AutoreleasePool Class Reference

Create an instance of a NSAutoreleasePool. More...

Public Member Functions

 AutoreleasePool () BURGER_NOEXCEPT
 Create an autoreleasepool.
 
 ~AutoreleasePool ()
 Release an autoreleasepool.
 

Private Attributes

void * m_pNSAutoreleasePool
 Pointer to the allocated NSAutoreleasePool.
 

Detailed Description

Create an instance of a NSAutoreleasePool.


For code written for Darwin based platforms, it may be needed to create an autoreleasepool. While modern compilers have a keyword of @autoreleasepool, older compilers do not. This class handles the case for both older and modern compilers for creating and releasing an autoreleasepool.

void foo() {
const AutoreleasePool Temp;
// Do code that creates pool memory
DoCocoaCode();
// On exit of the function, release the memory
}
Create an instance of a NSAutoreleasePool.
Definition burgerdarwin.h:26
Note
Only available on Darwin platforms when compiling using Objective-C or Objective-C++. If not, this class does not exist. Use the macro below for all cases.
See also
BURGER_SCOPED_AUTORELEASE

Constructor & Destructor Documentation

◆ AutoreleasePool()

Burger::AutoreleasePool::AutoreleasePool ( )

Create an autoreleasepool.


Calls [[NSAutoreleasePool alloc] init] and stores the pointer.

See also
BURGER_SCOPED_AUTORELEASE

◆ ~AutoreleasePool()

Burger::AutoreleasePool::~AutoreleasePool ( )

Release an autoreleasepool.


Calls [m_pAutoPool release] to release the pool

See also
BURGER_SCOPED_AUTORELEASE

Member Data Documentation

◆ m_pNSAutoreleasePool

void* Burger::AutoreleasePool::m_pNSAutoreleasePool
private

Pointer to the allocated NSAutoreleasePool.