Do not pass short-lived buffers as labels to Dart_TimelineEvent (flutter/engine#8166)
Dart no longer makes a copy of the label string when recording events. See https://github.com/flutter/engine/pull/8152
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user