mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-25 11:19:03 +01:00
UI: Lock around removal from dispatch queue.
This commit is contained in:
1 parent
2d4e45d229
commit
544576e6c2
1 file changed
+2
@@ -50,6 +50,7 @@ void DispatchEvents() {
|
||||
}
|
||||
|
||||
void RemoveQueuedEventsByView(View *view) {
|
||||
std::unique_lock<std::mutex> guard(eventMutex_);
|
||||
for (auto it = g_dispatchQueue.begin(); it != g_dispatchQueue.end(); ) {
|
||||
if (it->params.v == view) {
|
||||
it = g_dispatchQueue.erase(it);
|
||||
@@ -60,6 +61,7 @@ void RemoveQueuedEventsByView(View *view) {
|
||||
}
|
||||
|
||||
void RemoveQueuedEventsByEvent(Event *event) {
|
||||
std::unique_lock<std::mutex> guard(eventMutex_);
|
||||
for (auto it = g_dispatchQueue.begin(); it != g_dispatchQueue.end(); ) {
|
||||
if (it->e == event) {
|
||||
it = g_dispatchQueue.erase(it);
|
||||
|
||||
Reference in new issue
Block a user