Skip to content

Commit fb950dd

Browse files
Fix memory leak related to vertex/pixel/compute shader functions (o3de#18998) (o3de#19007)
Signed-off-by: Sidharth Moudgil <moudgils@amazon.com> Co-authored-by: moudgils <47460854+moudgils@users.noreply.github.com>
1 parent b7997a3 commit fb950dd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Gems/Atom/RHI/Metal/Code/Source/RHI/PipelineState.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,14 @@ namespace AZ
419419
{
420420
if (m_graphicsPipelineState)
421421
{
422+
if (m_renderPipelineDesc.vertexFunction)
423+
{
424+
[m_renderPipelineDesc.vertexFunction release];
425+
}
426+
if (m_renderPipelineDesc.fragmentFunction)
427+
{
428+
[m_renderPipelineDesc.fragmentFunction release];
429+
}
422430
[m_renderPipelineDesc release];
423431
m_renderPipelineDesc = nil;
424432
[m_graphicsPipelineState release];
@@ -427,6 +435,10 @@ namespace AZ
427435

428436
if (m_computePipelineState)
429437
{
438+
if (m_computePipelineDesc.computeFunction)
439+
{
440+
[m_computePipelineDesc.computeFunction release];
441+
}
430442
[m_computePipelineDesc release];
431443
m_computePipelineDesc = nil;
432444
[m_computePipelineState release];

0 commit comments

Comments
 (0)