Skip to content

Commit

Permalink
inspector: add missing initialization
Browse files Browse the repository at this point in the history
Add missing initialization reported by coverity. With
proper usage it looks like it will be initialized but
still good to have it initialized to a known state in
case that changes or invalide usage.

The method used to create object ids newObjectId() starts
at 1 so initializing to 0 should be safe and what we get
now when compiled in a way that auto initializes (for example
debug)

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: #43254
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
mhdawson authored and danielleadams committed Jun 16, 2022
1 parent 066f963 commit d2a98dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/inspector/tracing_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class TracingAgent : public NodeTracing::Backend {
Environment* env_;
std::shared_ptr<MainThreadHandle> main_thread_;
tracing::AgentWriterHandle trace_writer_;
int frontend_object_id_;
int frontend_object_id_ = 0;
std::shared_ptr<NodeTracing::Frontend> frontend_;
};

Expand Down

0 comments on commit d2a98dc

Please sign in to comment.