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

Fixed crashes on addon destruction. #348

Merged
merged 1 commit into from
Jan 9, 2018

Conversation

ksooo
Copy link
Member

@ksooo ksooo commented Jan 8, 2018

I noticed often crashes when deinstalling pvr.hts.

This PR fixes those crashes by:

  • closing demuxers before closing tvh connection and stopping tvh worker thread
  • ensuring CTvheadend thread worker function is exited when destructing the CTvheadend instance: StopThread(0) == "wait infinite" vs. StopThread()== "wait 5 secs" (5 secs are not enough sometimes).

The rest of the code changes is small cosmetical stuff, like

  • introduce CTvheadend::Stop as counterpart to existing CTvheadend::Start
  • do not check for tvhinstance presence where not needed
  • more intermediate IsStoppedcheck points in CTvheadend::Process

@ksooo
Copy link
Member Author

ksooo commented Jan 8, 2018

@Jalle19 mind taking a look?

Copy link
Contributor

@Jalle19 Jalle19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from the comment it looks fine, thanks!

void CTvheadend::Stop ( void )
{
for (auto *dmx : m_dmx)
dmx->Close();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we also do a delete?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, delete's are only done in the dtor. Stop just "resets".

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course

@ksooo ksooo merged commit e5e89b1 into kodi-pvr:master Jan 9, 2018
@ksooo ksooo deleted the fix-addon-destroy branch January 9, 2018 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants