#include #include #include #include #include ChannelRegionInfo* ChannelRegionInfo_Construct() { ChannelRegionInfo *pRegion = (ChannelRegionInfo*)malloc(sizeof(ChannelRegionInfo)); if(NULL == pRegion) { aloge("fatal error! malloc fail[%s]!", strerror(errno)); return NULL; } memset(pRegion, 0, sizeof(ChannelRegionInfo)); return pRegion; } void ChannelRegionInfo_Destruct(ChannelRegionInfo *pRegion) { if(pRegion->mBmp.mpData) { //don't free mpData, because memory is not malloc by channelRegionInfo, it is malloc by upper module. pRegion->mBmp.mpData = NULL; } free(pRegion); pRegion = NULL; }