Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in Algorithm destructor #365

Open
Archie3d opened this issue Mar 14, 2024 · 2 comments
Open

Memory leak in Algorithm destructor #365

Archie3d opened this issue Mar 14, 2024 · 2 comments

Comments

@Archie3d
Copy link

Running on Windows with MSVC, I am getting memory leak reports because of Algorithm::destroy not not freeing push and specialization constants. The comment says that they are supposed to be freed by the command buffer destructor, but I am not sure this is the case. When freeing them explicitly here like in the commented code, I don't get memory leaks from using constants anymore.

@axsaucedo
Copy link
Member

@Archie3d is this something you can provide an example to reproduce?

@Archie3d
Copy link
Author

@axsaucedo Any example that uses push or specialization constants leaks memory. Freeing these explicitly in Algorithm::destroy() fixes this issue (see Archie3d@5a564a1)

The commented code says that "vk::CommandBuffer frees the data", but this is not the case. vkCmdPushConstants does not mention anything about retaining the data pointer, and actually I don't think Vulkan ever retains any data pointer passed to it (please see this comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants