Fix dangling pointer after hipUnbindTexture() call
Change-Id: Ic4b476c62ebfae31e94dd139b20b6aaaa52bb866
[ROCm/hip commit: dbb8f96a8e]
Этот коммит содержится в:
@@ -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,
|
||||
|
||||
Ссылка в новой задаче
Block a user