Commit e514f232 authored by mike07026's avatar mike07026 Committed by GitHub

fix #1342 cause by ownership issues

parent b9649765
......@@ -165,7 +165,10 @@ DefaultValueObjectWriter* DefaultValueObjectWriter::RenderBytes(
if (current_ == NULL) {
ow_->RenderBytes(name, value);
} else {
RenderDataPiece(name, DataPiece(value, false, true));
// Since StringPiece is essentially a pointer, takes a copy of "value" to
// avoid ownership issues.
string_values_.push_back(new string(value.ToString()));
RenderDataPiece(name, DataPiece(*string_values_.back(), false, true));
}
return this;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment