Fix memory leak found by copilot#3728
Conversation
ff14307 to
fe225f2
Compare
softins
left a comment
There was a problem hiding this comment.
This looks good. I've built and tried it, and verified by adding debug messages that the deleteLater() is being called when it should be in each case.
| if ( pSettings->bEnableAudioAlerts && iNewNumClients > iClients ) | ||
| { | ||
| QSoundEffect* sf = new QSoundEffect(); | ||
| QSoundEffect* sf = new QSoundEffect ( this ); |
There was a problem hiding this comment.
I think I'd feel happier with this duplicated code factored out into a method. That way any future sound effects can be played by the same code, without having to write another copy.
Co-authored-by: softins <softins@users.noreply.github.com> See: jamulussoftware#3702
fe225f2 to
c408a02
Compare
|
Weird. It compiled for me locally. |
I think it might be better to put |
The Linux build in CI builds both a GUI and a headless version, and it is the headless one that is failing, because the include paths for QtWidgets, QtMultimedia and QtGUI are not in the headless build. If you want to keep |
|
I suppose if you might want to use it in |
|
I just pushed a commit to try it. |
|
Thanks. The idea was that one could use audio alerts everywhere. So util.* seemed the best fitting location. |
Not in the graphical UI, if it's avoidable. I'd rather we had the assistive UI support separately, so it could be used even if the graphical UI was not in used. There's too much functional code there. |
It's ok, we've left it in I think this is ready to go in now. |
Short description of changes
Tries to fix memory leak found by copilot: See: #3702 This should be valiated. I checked that the audio alerts still play - and it seems to work, but further investigation is still needed. I experienced hearing an audio-alert twice - but that may just be due to my testing mythology.
CHANGELOG: Bugfix: Fix memory leak for audio alerts
Context: Fixes an issue?
See: #3702
Does this change need documentation? What needs to be documented and how?
No
Status of this Pull Request
Needs review and testing.
What is missing until this pull request can be merged?
Testing
Checklist