Fixed two music bot hangups
This commit is contained in:
parent
0778b04b6b
commit
b7b22dc89e
@ -30,9 +30,12 @@ void AbstractMusicPlayer::unregisterEventHandler(const std::string& string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AbstractMusicPlayer::fireEvent(MusicEvent event) {
|
void AbstractMusicPlayer::fireEvent(MusicEvent event) {
|
||||||
std::lock_guard lock(this->eventLock);
|
decltype(this->eventHandlers) handlers{};
|
||||||
auto listCopy = this->eventHandlers; //Copy for remove while fire
|
{
|
||||||
for(const auto& entry : listCopy)
|
std::lock_guard lock(this->eventLock);
|
||||||
|
handlers = this->eventHandlers; //Copy for remove while fire
|
||||||
|
}
|
||||||
|
for(const auto& entry : handlers)
|
||||||
entry.second(event);
|
entry.second(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 71efb006ebdce2740e652306df36e34465a21dfc
|
Subproject commit 5f28af18dabd2ee8f3370bf564c1e287acad3af2
|
2
music
2
music
@ -1 +1 @@
|
|||||||
Subproject commit ed56872346f5e90320e62bf1b5e02466fb866b2e
|
Subproject commit e40ea16703252b64e1e8b744e7bd5cbc88e2941e
|
Loading…
x
Reference in New Issue
Block a user