Skip to content

Conversation

@ericcurtin
Copy link

Replaced all malloc/free calls with std::unique_ptr to leverage RAII for memory management. Used custom deleters where needed to handle specific free functions, such as stbi_image_free and free_sd_ctx. Simplified resource cleanup by removing explicit free calls, reducing the risk of memory leaks and improving code readability. Adjusted function calls to align with smart pointer usage, ensuring compatibility and preventing raw pointer access

Replaced all `malloc`/`free` calls with `std::unique_ptr` to leverage RAII for
memory management. Used custom deleters where needed to handle specific free
functions, such as `stbi_image_free` and `free_sd_ctx`. Simplified resource
cleanup by removing explicit `free` calls, reducing the risk of memory leaks
and improving code readability. Adjusted function calls to align with smart
pointer usage, ensuring compatibility and preventing raw pointer access

Signed-off-by: Eric Curtin <ecurtin@redhat.com>
@MrGeRoI
Copy link

MrGeRoI commented Nov 17, 2024

So true. I keep getting memory leaks bc it allocates memory for images but im getting crash when i trying to free them

@wbruna
Copy link
Contributor

wbruna commented Jun 19, 2025

This has good intentions, but the PR has many unrelated and inappropriate changes, like this one:

image

And things that look a lot like something an LLM would mess up (for instance, it's removing the whole img2vid call).

I realize this was submitted a long time ago, but if you can clean it up I'll review it again.

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

Successfully merging this pull request may close these issues.

3 participants