コード例 #1
0
ファイル: cm_event.cpp プロジェクト: lsun30/cmrt
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);
	}
}
コード例 #2
0
ファイル: cm_queue.cpp プロジェクト: mgherzan/cmrt
INT CmQueue::Destroy(CmQueue * &pQueue)
{
    if (pQueue == NULL) {
        return CM_FAILURE;
    }

    UINT result = pQueue->CleanQueue();
    CmSafeDelete(pQueue);

    return result;
}
コード例 #3
0
ファイル: cm_device.cpp プロジェクト: gbeauchesne/cmrt
INT CmDevice_RT::Destroy(CmDevice_RT * &pDevice)
{
	INT result = CM_SUCCESS;

	INT refCount = pDevice->Release();

	if (refCount == 0) {
		CmSafeDelete(pDevice);
	}

	return result;
}