Skip to content

Commit 7ac5c1f

Browse files
S1artiemagreenblatt
authored andcommitted
Fix queuedCommands memory leak in CefDevToolsClient
1 parent 2caef5a commit 7ac5c1f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

java/org/cef/browser/CefDevToolsClient.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public void onDevToolsMethodResult(
3636
future.completeExceptionally(
3737
new DevToolsException("DevTools method failed", result));
3838
}
39+
removeQueuedCommand(messageId);
3940
}
4041

4142
@Override
@@ -62,6 +63,10 @@ private CompletableFuture<String> getQueuedCommand(Integer messageId) {
6263
return queuedCommands_.computeIfAbsent(messageId, key -> new CompletableFuture<>());
6364
}
6465

66+
private void removeQueuedCommand(Integer messageId) {
67+
queuedCommands_.remove(messageId);
68+
}
69+
6570
/**
6671
* Execute a method call over the DevTools protocol. See the <a
6772
* href=https://chromedevtools.github.io/devtools-protocol/> DevTools protocol documentation</a>

0 commit comments

Comments
 (0)