Skip to content

fix #29#32

Merged
freelw merged 1 commit intomainfrom
wangli_dev_20250615_1
Jun 15, 2025
Merged

fix #29#32
freelw merged 1 commit intomainfrom
wangli_dev_20250615_1

Conversation

@freelw
Copy link
Copy Markdown
Owner

@freelw freelw commented Jun 15, 2025

fix #29

@freelw freelw requested a review from Copilot June 15, 2025 00:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes issue #29 by ensuring the Metal compute pipeline state object is released after being set on the encoder to prevent a memory leak.

  • Added pipelineState->release() after setComputePipelineState in prepare().

throw std::runtime_error("Failed to create compute pipeline state");
}
encoder->setComputePipelineState(pipelineState);
pipelineState->release();
Copy link

Copilot AI Jun 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using an RAII wrapper or smart pointer for MTL::ComputePipelineState objects to automatically manage reference counting and avoid manual release() calls.

Copilot uses AI. Check for mistakes.
@freelw freelw merged commit 43f4e87 into main Jun 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants