Skip to content

Commit

Permalink
fix: Correctly initialize context in inspector client init()
Browse files Browse the repository at this point in the history
I'm not sure about this, but I think the code was initializing context_
with its own initial value (i.e. nullptr), rather than the isolate's
context. This seemed to trigger an error when sending a message to the
frontend, which this change fixed.
  • Loading branch information
ptomato committed Mar 7, 2023
1 parent 221a9c2 commit 0bc0480
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test-app/runtime/src/main/cpp/JsV8InspectorClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ void JsV8InspectorClient::init() {

inspector_->contextCreated(v8_inspector::V8ContextInfo(context, JsV8InspectorClient::contextGroupId, v8_inspector::StringView()));

v8::Persistent<v8::Context> persistentContext(context->GetIsolate(), JsV8InspectorClient::PersistentToLocal(isolate_, context_));
context_.Reset(isolate_, persistentContext);
context_.Reset(isolate_, context);

this->createInspectorSession(isolate_, context);
}
Expand Down

0 comments on commit 0bc0480

Please sign in to comment.