diff options
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()); } - |