-
Notifications
You must be signed in to change notification settings - Fork 329
added dispose() on some dialogs (fix memory leaks) #6959
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds dispose() calls via overriding cancelAction() in both dialog classes to ensure proper resource cleanup when a cancel action is triggered.
- Overrides cancelAction() in WeightDisplayDialog to call dispose().
- Overrides cancelAction() in CostDisplayDialog to call dispose().
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
megamek/src/megamek/client/ui/dialogs/WeightDisplayDialog.java | Added cancelAction() override that calls dispose() for proper resource cleanup. |
megamek/src/megamek/client/ui/dialogs/CostDisplayDialog.java | Added cancelAction() override that calls dispose() for proper resource cleanup. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6959 +/- ##
=========================================
Coverage 30.31% 30.31%
- Complexity 15807 15810 +3
=========================================
Files 2886 2886
Lines 283126 283140 +14
Branches 49326 49326
=========================================
+ Hits 85833 85844 +11
+ Misses 191694 191691 -3
- Partials 5599 5605 +6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR fixes few memory leaks.
Added dispose() calls to:
those are dialogs that are spawned every time, never reused.