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 small memory leak on chat. #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

rapito
Copy link
Collaborator

@rapito rapito commented Jun 19, 2023

Description

  • Free Memory decreases when you open and close the chat window.
  • Free Memory decreases when a new message is shown and then destroyed.

Changes

  • Refactor SysText to return a Systext on st_build and to handle it's own cleanup properly.
  • Change cleanup order of Systext to prevent leaks
  • Free several allocated objects that were never freed
  • Refactor some methods to return the effective used attribute instead of a full object pointer.

Results

Memory is not leaking now, so the issue is fixed, however, It seems like the game allocates some space on the initial load of JOBJs and Text structs that we can never recover unless we get real annoyed by it.

I spent some time trying to figure it out but it seems like it's just a cache thing.

The actual memory seems to now decrease any further after the initial load.

image

…wn cleanup properly.

+ Change cleanup order of Systext to prevent leaks
+ Free several allocated objects that were never freed
+ Refactor some methods to return the effective used attribute instead of a full object pointer.
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.

1 participant