mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
audio/internal/oboe: Bug fix: Use-after-free of a player
In theory, a closed player was used unexpectedly by these steps: 1. Suspend is called by switching the application 2. Player_Close is called 3. Resume is called by reactivating the application The set of GetPlayersToResume() had a closed player and the trying to play it caused the use-after-free problem. This changes fixes the issue by removing the player from the set of GetPlayerToResume() when closing it. iOS version already has the logic to remove the player appropriately. Updates #1645 Closes #1646
This commit is contained in:
parent
5f773a3277
commit
2edb286ec4
1
audio/internal/oboe/binding_android.cpp
vendored
1
audio/internal/oboe/binding_android.cpp
vendored
@ -141,6 +141,7 @@ public:
|
|||||||
std::lock_guard<std::mutex> lock(PlayersMutex());
|
std::lock_guard<std::mutex> lock(PlayersMutex());
|
||||||
const char* msg = Close();
|
const char* msg = Close();
|
||||||
GetPlayers().erase(this);
|
GetPlayers().erase(this);
|
||||||
|
GetPlayersToResume().erase(this);
|
||||||
return msg;
|
return msg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user