Skip to content

Commit 7a6e3d9

Browse files
committed
fix(inspector): clear resource streams on disconnect to prevent stale connections
1 parent f45830a commit 7a6e3d9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test-app/runtime/src/main/cpp/JsV8InspectorClient.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,13 @@ void JsV8InspectorClient::createInspectorSession() {
231231
}
232232

233233
void JsV8InspectorClient::disconnect() {
234+
{
235+
// Streams only have meaning to the frontend that opened them; drop any
236+
// the old connection never read to the end (or never IO.close-d).
237+
std::lock_guard<std::mutex> lock(resourceStreamsMutex_);
238+
resourceStreams_.clear();
239+
}
240+
234241
if (connection_ == nullptr) {
235242
return;
236243
}

0 commit comments

Comments
 (0)