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

Delete ADSBDemod::m_worker after removing sink from DSP #916

Conversation

ChiefGokhlayeh
Copy link
Contributor

Fixes #915.

As described in the issue, during deconstruction of ADSBDemod a segmentation fault might occur, if DSPDeviceSourceEngine calls sink->stop() after m_worker was deleted.

This PR fixes the issue by deleting m_worker only after m_deviceAPI->removeChannelSink(this) is called. This call would otherwise invoke sink->stop() with a broken m_worker somewhere down the line.

@ChiefGokhlayeh ChiefGokhlayeh changed the title Delete ADSBDemods' m_worker after removing sink from DSP Delete ADSBDemod::m_worker after removing sink from DSP Jun 4, 2021
@ChiefGokhlayeh
Copy link
Contributor Author

I scanned through the other channelrx plugins and didn't find any bugs of the same type.

@f4exb
Copy link
Owner

f4exb commented Jun 5, 2021

It does not hurt and incidentally solves the issue. Moreover now the deletion occurs in reverse order of creation (m_networkManager is created last). But as I said in my comments of #915 in the first place the various workers should take care of their running state before doing the stopping job (same thing for start) because their stopWork method may be called several times legitimately.

@f4exb f4exb merged commit eb811c1 into f4exb:master Jun 5, 2021
@ChiefGokhlayeh ChiefGokhlayeh deleted the bugfix/#915-segmentation-fault-when-closing-ads-b-panel-while-sampling-device-is-still-running branch June 5, 2021 07:33
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.

Segmentation Fault when closing ADS-B panel while Sampling Device is still running
2 participants