ZFFramework
 
Loading...
Searching...
No Matches
ZFThread_zfobjAutoRelease.h File Reference

thread utility More...

#include "ZFThread.h"

Go to the source code of this file.

Macros

#define zfobjAutoRelease(obj)
 make object autorelease, which would be released by the owner thread
 
#define zfobjAutoRelease(obj)
 make object autorelease, which would be released by the owner thread
 

Detailed Description

thread utility

Macro Definition Documentation

◆ zfobjAutoRelease [1/2]

#define zfobjAutoRelease ( obj)

make object autorelease, which would be released by the owner thread

calling this function will add the object to current thread's autorelease pool
assert failure if current thread isn't started or registered by ZFThread
note that which time to release the objects in pool, is depends on implementation

See also
zfobjRetain, zfobjRelease

ADVANCED:
this method depends on ZFThread's implementation
if no ZFThread's implementation found, we'll try to add to global memory pool (see ZFAutoReleasePool::instance), which should be drained manually

so, try not to abuse this method, since:

  • the actual behavior depends on ZFThread's implementation
  • it have lower performance than other release methods (see ZFObject for more info about other release methods)
See also
zfobjAutoRelease

◆ zfobjAutoRelease [2/2]

#define zfobjAutoRelease ( obj)

make object autorelease, which would be released by the owner thread

calling this function will add the object to current thread's autorelease pool
assert failure if current thread isn't started or registered by ZFThread
note that which time to release the objects in pool, is depends on implementation

See also
zfobjRetain, zfobjRelease

ADVANCED:
this method depends on ZFThread's implementation
if no ZFThread's implementation found, we'll try to add to global memory pool (see ZFAutoReleasePool::instance), which should be drained manually

so, try not to abuse this method, since:

  • the actual behavior depends on ZFThread's implementation
  • it have lower performance than other release methods (see ZFObject for more info about other release methods)
See also
zfobjAutoRelease