Skip to content

Commit

Permalink
Add __autoreleasing for pointer to pointer.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Bonnefoy committed Sep 27, 2012
1 parent b452ae4 commit 4193e7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/compiler/objc_primitive_field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ namespace google { namespace protobuf { namespace compiler { namespace objective
printer->Print(variables_,
"const NSUInteger $list_name$Count = self.$list_name$.count;\n"
"if ($list_name$Count > 0) {\n"
" const $storage_type$ *values = (const $storage_type$ *)self.$list_name$.data;\n");
" const $storage_type$ __autoreleasing *values = (const $storage_type$ __autoreleasing *)self.$list_name$.data;\n");
printer->Indent();

if (descriptor_->options().packed()) {
Expand Down Expand Up @@ -603,7 +603,7 @@ namespace google { namespace protobuf { namespace compiler { namespace objective

if (FixedSize(descriptor_->type()) == -1) {
printer->Print(variables_,
"const $storage_type$ *values = (const $storage_type$ *)self.$list_name$.data;\n"
"const $storage_type$ __autoreleasing *values = (const $storage_type$ __autoreleasing *)self.$list_name$.data;\n"
"for (NSUInteger i = 0; i < count; ++i) {\n"
" dataSize += compute$capitalized_type$SizeNoTag(values[i]);\n"
"}\n");
Expand Down

0 comments on commit 4193e7c

Please sign in to comment.