Don't crash for hipEventDestroy(NULL)

Change-Id: I3f4de1ad2712dbe8af81e10c5d3bef16d468c582
이 커밋은 다음에 포함됨:
Maneesh Gupta
2017-07-18 11:01:02 +05:30
부모 205b98af10
커밋 7ddb6b6b76
+8 -5
파일 보기
@@ -164,13 +164,16 @@ hipError_t hipEventDestroy(hipEvent_t event)
{
HIP_INIT_API(event);
event->_state = hipEventStatusUnitialized;
if (event) {
event->_state = hipEventStatusUnitialized;
delete event;
event = NULL;
delete event;
event = NULL;
// TODO - examine return additional error codes
return ihipLogStatus(hipSuccess);
return ihipLogStatus(hipSuccess);
} else {
return ihipLogStatus(hipErrorInvalidResourceHandle);
}
}
hipError_t hipEventSynchronize(hipEvent_t event)