Repository navigation
Conversation
The connection manager thread can still be in its M3U check when the instance is destroyed. If the check then succeeds, it calls ConnectionEstablished(), which starts the update thread after the destructor has already looked for it, and destroying the still-joinable std::thread calls std::terminate(). Stop the connection manager first, so nothing can start the update thread once the destructor joins it.
1 of 7 tasks
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.
Description
Kodi aborts in
~IptvSimple()if the add-on is disabled while its connection manager is still checking the M3U URL.The destructor sets
m_running = falseand skips the join, because the update thread hasn't started yet. Then it callsconnectionManager->Stop(), which waits for the connection thread. That thread is still inWebUtils::Check(). When the check succeeds,ConnectionManager::Process()callsSetState(PVR_CONNECTION_STATE_CONNECTED), soConnectionEstablished()loads the playlist, setsm_running = trueand startsm_thread. The destructor then finishes, and the still-joinablestd::threadmember callsstd::terminate().This change stops the connection manager first, so nothing can start the update thread once the destructor joins it.
Backtrace of the aborting thread without the change:
Testing
Kodi 22.0 RC1 (Piers) flatpak on Linux x86_64, pvr.iptvsimple 22.6.5 (6d334f6):
Addons.SetAddonEnabled.(Diagnosed with Claude Code.)