mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-22 02:11:38 +00:00
Dereference D-Bus connection even when media is playing
This commit is contained in:
parent
43da7d33f3
commit
809c4fcb93
1 changed files with 7 additions and 3 deletions
|
|
@ -176,14 +176,18 @@ bool os::media::IsExternalMediaPlaying()
|
||||||
if (!dbusConnection)
|
if (!dbusConnection)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
bool result = false;
|
||||||
|
|
||||||
std::vector<std::string> busNames = GetMediaPlayerBusNames(dbusConnection);
|
std::vector<std::string> busNames = GetMediaPlayerBusNames(dbusConnection);
|
||||||
for (const auto& bus : busNames)
|
for (const auto& bus : busNames)
|
||||||
{
|
{
|
||||||
if (IsMediaPlayerPlaying(dbusConnection, bus))
|
if (IsMediaPlayerPlaying(dbusConnection, bus))
|
||||||
return true;
|
{
|
||||||
|
result = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DestroyDBusConnection(dbusConnection);
|
DestroyDBusConnection(dbusConnection);
|
||||||
|
return result;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue