Skip to content

Commit

Permalink
Do not pass short-lived buffers as labels to Dart_TimelineEvent (flut…
Browse files Browse the repository at this point in the history
…ter#8166)

Dart no longer makes a copy of the label string when recording events.

See flutter#8152
  • Loading branch information
jason-simmons authored Mar 14, 2019
1 parent e514f0b commit 403337e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fml/trace_event.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@ void TraceEventFlowEnd0(TraceArg category_group, TraceArg name, TraceIDArg id);

class ScopedInstantEnd {
public:
ScopedInstantEnd(std::string str) : label_(std::move(str)) {}
ScopedInstantEnd(const char* str) : label_(str) {}

~ScopedInstantEnd() { TraceEventEnd(label_.c_str()); }
~ScopedInstantEnd() { TraceEventEnd(label_); }

private:
const std::string label_;
const char* label_;

FML_DISALLOW_COPY_AND_ASSIGN(ScopedInstantEnd);
};
Expand Down

0 comments on commit 403337e

Please sign in to comment.