Merge pull request #1357 from MinusGix/fix-proxy-hang

Fix proxy hang due to held lock
This commit is contained in:
Dániel Buga 2022-09-26 09:04:59 +02:00 committed by GitHub
commit 233a32d558
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -385,7 +385,8 @@ pub fn handle_response(
id: RequestId,
result: Result<ProxyResponse, RpcError>,
) {
if let Some(handler) = self.pending.lock().remove(&id) {
let handler = { self.pending.lock().remove(&id) };
if let Some(handler) = handler {
handler.invoke(result);
}
}