mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-03-03 03:27:19 +00:00
Common: Avoid buildup of blank callbacks.
This commit is contained in:
parent
089580d09a
commit
d621bbd73d
@ -19,14 +19,14 @@ bool RequestManager::MakeSystemRequest(SystemRequestType type, RequestCallback c
|
||||
int requestId = idCounter_++;
|
||||
|
||||
// NOTE: We need to register immediately, in order to support synchronous implementations.
|
||||
{
|
||||
if (callback || failedCallback) {
|
||||
std::lock_guard<std::mutex> guard(callbackMutex_);
|
||||
callbackMap_[requestId] = { callback, failedCallback };
|
||||
}
|
||||
|
||||
INFO_LOG(SYSTEM, "Making system request %s: id %d", RequestTypeAsString(type), requestId);
|
||||
if (!System_MakeRequest(type, requestId, param1, param2, param3)) {
|
||||
{
|
||||
if (callback || failedCallback) {
|
||||
std::lock_guard<std::mutex> guard(callbackMutex_);
|
||||
callbackMap_.erase(requestId);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user