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

Fix issues with Atlas leaking memory. #721

Merged
merged 3 commits into from
May 3, 2024

Conversation

profan
Copy link
Sponsor Contributor

@profan profan commented May 2, 2024

Split this out from the other PR so at least this change would go in, since it seems mostly unproblematic :)

@profan
Copy link
Sponsor Contributor Author

profan commented May 2, 2024

I guess one question here might be, maybe that delete function I added does not need to be public?

Made it private instead, no need to expose more API surface just to fix a leak.

* Fix issue with Font Atlas leaking memory by adding a drop impl, reported in issue not-fl3#627
@@ -184,4 +190,8 @@ impl Atlas {
);
}
}
fn delete(&mut self) {
let ctx = &mut get_context().quad_context;
ctx.delete_texture(self.texture);
Copy link
Owner

Choose a reason for hiding this comment

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

I believe we used to have delete on everything, but now, with Drop, should it really be a separate function, not just drop?

Copy link
Sponsor Contributor Author

@profan profan May 3, 2024

Choose a reason for hiding this comment

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

Yeah that's fair, it's probably an entirely unnecessary convention to follow now, I'll remove the delete function and just have the Drop impl :)

.. Deleted the delete function :D

@profan profan requested a review from not-fl3 May 3, 2024 17:34
@not-fl3 not-fl3 merged commit 7faf16a into not-fl3:master May 3, 2024
6 checks passed
@not-fl3
Copy link
Owner

not-fl3 commented May 3, 2024

Thanks for PR! 👍

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.

2 participants