Fix dangling pointer after hipUnbindTexture() call

Change-Id: Ic4b476c62ebfae31e94dd139b20b6aaaa52bb866


[ROCm/hip commit: dbb8f96a8e]
This commit is contained in:
Vladislav Sytchenko
2020-03-06 14:10:56 -05:00
orang tua 8bf13d8d20
melakukan 42d9576cbe
+5 -2
Melihat File
@@ -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,