diff options
author | Benoit Foucher <benoit@zeroc.com> | 2015-02-20 15:48:50 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2015-02-20 15:48:50 +0100 |
commit | 6912a3e2c742e0243130d989f558131f0c73b54e (patch) | |
tree | 708610eaf0d52e0d35fde0661a4ded595efe424a /cpp/src/Slice/ObjCUtil.cpp | |
parent | build fix (diff) | |
download | ice-6912a3e2c742e0243130d989f558131f0c73b54e.tar.bz2 ice-6912a3e2c742e0243130d989f558131f0c73b54e.tar.xz ice-6912a3e2c742e0243130d989f558131f0c73b54e.zip |
Additional fix for ICE-6268, fixed struct un-marshalling to not re-create the struct
Diffstat (limited to 'cpp/src/Slice/ObjCUtil.cpp')
-rw-r--r-- | cpp/src/Slice/ObjCUtil.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/cpp/src/Slice/ObjCUtil.cpp b/cpp/src/Slice/ObjCUtil.cpp index e449ea87539..77a2d627ece 100644 --- a/cpp/src/Slice/ObjCUtil.cpp +++ b/cpp/src/Slice/ObjCUtil.cpp @@ -848,13 +848,27 @@ Slice::ObjCGenerator::writeMarshalUnmarshalCode(Output &out, const TypePtr& type } else { - if(autoreleased) + if(StructPtr::dynamicCast(type)) { - out << nl << param << " = [" << name << " read:" << stream << "];"; + if(autoreleased) + { + out << nl << param << " = [" << name << " read:" << stream << " value:" << param << "];"; + } + else + { + out << nl << param << " = [" << name << " readRetained:" << stream << " value:" << param << "];"; + } } else { - out << nl << param << " = [" << name << " readRetained:" << stream << "];"; + if(autoreleased) + { + out << nl << param << " = [" << name << " read:" << stream << "];"; + } + else + { + out << nl << param << " = [" << name << " readRetained:" << stream << "];"; + } } } } @@ -1294,4 +1308,3 @@ Slice::ObjCGenerator::MetaDataVisitor::modulePrefixError(const ModulePtr& m, con os << " as `" << mp.name << "'" << endl; emitWarning(file, line, os.str()); } - |