Bug in SimpleAudioEngine on Mac OS X

This method is buggy, located in the file

cocos2d-x-3.6\cocos\audio\mac\SimpleAudioEngine.mm

This method, unlike the other SimpleAudioEngine implementations, fails to stop the currently playing music.

void SimpleAudioEngine::playBackgroundMusic(const char* pszFilePath, bool bLoop)
{
    // Changing file path to full path
    std::string fullPath = FileUtils::getInstance()->fullPathForFilename(pszFilePath);
    static_playBackgroundMusic(fullPath.c_str(), bLoop);
}

To fix, add a patch that first calls

static_stopBackgroundMusic();

early in the method playBackgroundMusic: