-
Notifications
You must be signed in to change notification settings - Fork 15
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 the heap-use-after-free and memory leak #54
Conversation
However, if this is the solution, the |
Quote from SDL manual about SDL_Quit
Since checking for events is no longer allowed after invoking |
AddressSanitizer reports:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using backticks in git commit messages and comments to ensure compatibility with terminal emulators that may not render the backtick character properly.
Instead, use the pair '
or "
(quotation marks).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Append Close #49
at the end of git commit message since this pull request does resolve the issue.
To fix the heap-use-after-free issue when 'screen' is accessed by the 'twin_sdl_work()' function, remove the '_twin_sdl_destroy(screen, tx)' operation. Additionally, to address the memory leak, add the 'twin_path_destroy(path)' function to ensure the unused path is properly destroyed. Add the operation to deallocate 'frame', as it will no longer be used in the future. Close sysprog21#49
Thank @weihsinyeh for contributing! |
To fix the heap-use-after-free issue when
screen
is accessed by thetwin_sdl_work()
function, remove the_twin_sdl_destroy(screen, tx)
operation. Additionally, to address the memory leak, add thetwin_path_destroy(path)
function to ensure the unused path is properly destroyed.Close #49