Stop a looping sound with play only

Sorry, I was maybe a bit sparse. I’m using the Studio API and I’m wondering how to handle entity looped sounds. Eg this can be part of the gameloop for an entity

if (CertainCondition()){
    sound_engine_.PlaySound(my_sound);
}

If my_sound is looped, PlaySound() shall check if the sound is already playing and then do nothing. Eg by checking an std::map where all playing instances are stored. During the gameloop update-call, non playing instances are removed from that map.

But what about stopping? I could add an else block with StopSound() which would then go to the same map and stops the instance. But what if the entity is destroyed? Then the destructor should have some sort of stop all sounds for this entity? And what if someone forgets to add a stop-call?

Another option would be to let PlaySound() set a flag for that instance (yes, in that map) and then in the general update-call check if the flag is set, if not, stop the sound and remove it, if it is set, reset the flag and wait for the next update-call.

But maybe there are other design options. So is there a standard or preferred way to tackle this issue?