fix #1342 cause by ownership issues
This commit is contained in:
parent
b9649765f8
commit
e514f232a0
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue