diff options
Diffstat (limited to 'cpp/src')
-rwxr-xr-x | cpp/src/Slice/CsUtil.cpp | 3 | ||||
-rwxr-xr-x | cpp/src/slice2cs/Gen.cpp | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp index ae4575cfe7a..efe16a9162f 100755 --- a/cpp/src/Slice/CsUtil.cpp +++ b/cpp/src/Slice/CsUtil.cpp @@ -600,9 +600,10 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << sb; out << nl << "int sz = " << stream << ".readSize();"; out << nl << stream << ".startSeq(sz, " << static_cast<unsigned>(type->minWireSize()) << ");"; + out << nl << param << " = new "; if(isArray) { - out << nl << param << " = new " << typeS << "[sz]"; + out << typeS << "[sz]"; } else { diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index 4640b491018..abfe1de6d59 100755 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -1211,9 +1211,7 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) patchParams << ", " << classMemberCount++; } } - _out << sb; writeMarshalUnmarshalCode(_out, (*d)->type(), fixId((*d)->name()), false, false, patchParams.str()); - _out << eb; } _out << nl << "__is.endReadSlice();"; _out << nl << "base.__read(__is, true);"; |