CmEvent::~CmEvent(void) { if (m_SurEntryInfoArrays.pSurfEntryInfosArray != NULL) { for (UINT i = 0; i < m_SurEntryInfoArrays.dwKrnNum; i++) { if (m_SurEntryInfoArrays. pSurfEntryInfosArray[i].pSurfEntryInfos != NULL) { CmSafeDelete (m_SurEntryInfoArrays.pSurfEntryInfosArray [i].pSurfEntryInfos); } if (m_SurEntryInfoArrays. pSurfEntryInfosArray[i].pGlobalSurfInfos != NULL) { CmSafeDelete (m_SurEntryInfoArrays.pSurfEntryInfosArray [i].pGlobalSurfInfos); } } CmSafeDelete(m_SurEntryInfoArrays.pSurfEntryInfosArray); } if (m_KernelNames != NULL) { for (UINT i = 0; i < m_KernelCount; i++) { CmSafeDeleteArray(m_KernelNames[i]); } CmSafeDeleteArray(m_KernelNames); CmSafeDeleteArray(m_ThreadSpace); } }
INT CmQueue::Destroy(CmQueue * &pQueue) { if (pQueue == NULL) { return CM_FAILURE; } UINT result = pQueue->CleanQueue(); CmSafeDelete(pQueue); return result; }
INT CmDevice_RT::Destroy(CmDevice_RT * &pDevice) { INT result = CM_SUCCESS; INT refCount = pDevice->Release(); if (refCount == 0) { CmSafeDelete(pDevice); } return result; }