Fix: memory leaks in sound player, dialogs#9142
Merged
vadi2 merged 8 commits intoMudlet:developmentfrom Apr 8, 2026
Merged
Conversation
Use std::unique_ptr for TMediaPlaylist ownership. Delete QAudioOutput in destructor since setAudioOutput() doesn't take ownership in Qt6.
QKeySequence is a lightweight, implicitly-shared value class that doesn't need heap allocation. The pointer-based QMap entries were never freed, leaking on every dialog close.
QActions were parented to TTextEdit (this) but the QMenu used WA_DeleteOnClose, so the QActions leaked on every right-click. Parent them to the QMenu so they're deleted with it.
- Call inflateEnd() on disconnect and destruction when MCCP compression is active (~256KB leaked per connect/disconnect cycle) - Add reply->deleteLater() to early-return error paths in slot_replyFinished() that were skipping cleanup
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
Contributor
Contributor
|
Reviews (1): Last reviewed commit: "Apply clang-format to changed files" | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Contributor
|
Verified sound/music works. |
ZookaOnGit
approved these changes
Apr 7, 2026
Contributor
ZookaOnGit
left a comment
There was a problem hiding this comment.
everything looks as per normal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief overview of PR changes/additions
Fixes memory leaks from playing sounds, opening the room exits dialog, opening Preferences, right-clicking the console, connecting to MUDs with compression, and viewing changelogs
Motivation for adding to Mudlet
Better memory management.
Other info (issues closed, discussion etc)
3. TMediaPlayer destructor leaks TMediaPlaylist + QAudioOutput
6. dlgRoomExits TExit objects never freed
7. dlgProfilePreferences QKeySequence* leak (no destructor)
10. ctelnet missing inflateEnd in destructor
11. ctelnet QNetworkReply leak on file error paths
15. TTextEdit QAction accumulation (5-10 per right-click)
17. Updater changelog dialogs leaked
20. ModernGLWidget mTexCoordBuffer.destroy() missing
21. dlgComposer context menu + Hunspell suggestions
22-24. Lower-impact (also in this branch)