dataengines/mpris2: Do not create a new container if there is a pending container with the same name
dataengines/mpris2: Do not create a new container if there is a pending container with the same name
It's possible that a container createdin Mpris2Engine::serviceNameFetchFinished
has not emitted PlayerContainer::initialFetchFinished
yet, but
Mpris2Engine::serviceOwnerChanged has already created a container with the
same name.
A possible order that will create two containers with the same name:
-
serviceNameFetchFinished
callsaddMediaPlayer
-
addMediaPlayer
creates a new PlayerContainer -
Mpris2Engine::initialFetchFinished
is not emitted. - serviceOwnerChanged watcher starts.
-
QDBusServiceWatcher::serviceOwnerChanged
->Mpris2Engine::serviceOwnerChanged
-
Mpris2Engine::serviceOwnerChanged
callsaddMediaPlayer
-
addMediaPlayer
creates a new PlayerContainer with the same sourceName in STEP 2. - Crash
Edited by Fushan Wen