Skip to content

Commit

Permalink
Merge pull request #778 from johzzy/master
Browse files Browse the repository at this point in the history
fix crash
  • Loading branch information
kyleneideck authored Dec 6, 2024
2 parents 4b7caee + 51e1266 commit 784bb24
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions BGMApp/BGMApp/BGMAudioDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ BGMAudioDevice::~BGMAudioDevice()
bool BGMAudioDevice::CanBeOutputDeviceInBGMApp() const
{
CFStringRef uid = CopyDeviceUID();
assert(uid != nullptr);

bool isNullDevice = CFEqual(uid, CFSTR(kBGMNullDeviceUID));
CFRelease(uid);

Expand Down Expand Up @@ -340,6 +342,9 @@ bool BGMAudioDevice::IsBGMDevice(bool inIncludeUISoundsInstance) const
{
// Check the device's UID to see whether it's BGMDevice.
CFStringRef uid = CopyDeviceUID();
if (uid == nullptr) {
return isBGMDevice;
}

isBGMDevice =
CFEqual(uid, CFSTR(kBGMDeviceUID)) ||
Expand Down

0 comments on commit 784bb24

Please sign in to comment.