Fix memory leak in RenderTargetPool on texture init fail
This commit is contained in:
committed by
Wojtek Figat
parent
d2c252879e
commit
5c443f305d
@@ -73,6 +73,7 @@ GPUTexture* RenderTargetPool::Get(const GPUTextureDescription& desc)
|
||||
auto newRenderTarget = GPUDevice::Instance->CreateTexture(name);
|
||||
if (newRenderTarget->Init(desc))
|
||||
{
|
||||
Delete(newRenderTarget);
|
||||
LOG(Error, "Cannot create temporary render target. Description: {0}", desc.ToString());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user