Fix dangling pointer after hipUnbindTexture() call

Change-Id: Ic4b476c62ebfae31e94dd139b20b6aaaa52bb866


[ROCm/hip commit: dbb8f96a8e]
Этот коммит содержится в:
Vladislav Sytchenko
2020-03-06 14:10:56 -05:00
родитель 8bf13d8d20
Коммит 42d9576cbe
+5 -2
Просмотреть файл
@@ -597,10 +597,13 @@ hipError_t hipUnbindTexture(const textureReference* texref) {
HIP_INIT_API(hipUnbindTexture, texref);
if (texref == nullptr) {
return hipErrorInvalidValue;
HIP_RETURN(hipErrorInvalidValue);
}
HIP_RETURN(ihipDestroyTextureObject(texref->textureObject));
const hipTextureObject_t textureObject = texref->textureObject;
const_cast<textureReference*>(texref)->textureObject = nullptr;
HIP_RETURN(ihipDestroyTextureObject(textureObject));
}
hipError_t hipBindTexture(size_t* offset,