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 a few memory leaks and race conditions #2330

Merged
merged 2 commits into from
Nov 14, 2024
Merged

Conversation

srcejon
Copy link
Collaborator

@srcejon srcejon commented Nov 14, 2024

This PR fixes a few memory leaks and race conditions noticed while investigating #2315.

In FreeDV:

  • Fix buffer overflow by using freedv_get_n_max_speech_samples instead of freedv_get_n_speech_samples
  • Fix memory leak for m_speechOut and m_modIn
  • Call stop() before delete, to avoid "QThread: Destroyed while thread is still running"

In mainwindow.cpp/dspengine.cpp:

  • Fix memory leak by deleting m_deviceSourceEngine after it is last used.
  • Fix race condition by connecting to thread before exit is called.

We still have a problem causing the crash in #2315 though - will add a further comment there.

Copy link

sonarcloud bot commented Nov 14, 2024

@f4exb f4exb merged commit 7bc6210 into f4exb:master Nov 14, 2024
4 of 5 checks passed
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.

2 participants