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 script engine memory leak #603

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

GriffinRichards
Copy link
Collaborator

@GriffinRichards GriffinRichards commented Aug 11, 2024

The script API was leaking the memory allocated for the QJSEngine and ScriptUtility (the former may be freed when Porymap is quit but not during project open/close). The engine was taking ownership of the main window, so deleting it would have caused a crash.

It was also possible to call utility.setTimeout, switch projects, and have the timeout trigger in the new project. Because the engine gets interrupted (and interruption errors are silenced) this wouldn't be visible to the user, but that was fixed anyway.

@GriffinRichards GriffinRichards merged commit 2c1d363 into huderlem:master Aug 13, 2024
3 checks passed
@GriffinRichards GriffinRichards deleted the engine-leak branch August 13, 2024 19:22
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