当前位置 : 主页 > 手机开发 > harmonyos >

cocos2dx之内存管理的几个自动释放内存的宏及条件判断

来源:互联网 收集:自由互联 发布时间:2023-08-25
#define CC_SAFE_DELETE(p) do { if(p) { delete (p); (p) = 0; } } while(0)#define CC_SAFE_DELETE_ARRAY(p) do { if(p) { delete[] (p); (p) = 0; } } while(0)#define CC_SAFE_FREE(p) do { if(p) { free(p); (p) = 0; } } while(0)#define CC_SAFE_RELEA


#define CC_SAFE_DELETE(p)            do { if(p) { delete (p); (p) = 0; } } while(0)
#define CC_SAFE_DELETE_ARRAY(p)     do { if(p) { delete[] (p); (p) = 0; } } while(0)
#define CC_SAFE_FREE(p)                do { if(p) { free(p); (p) = 0; } } while(0)
#define CC_SAFE_RELEASE(p)            do { if(p) { (p)->release(); } } while(0)
#define CC_SAFE_RELEASE_NULL(p)        do { if(p) { (p)->release(); (p) = 0; } } while(0)
#define CC_SAFE_RETAIN(p)            do { if(p) { (p)->retain(); } } while(0)
#define CC_BREAK_IF(cond)            if(cond) break



上一篇:C++ 虚函数表解析
下一篇:没有了
网友评论