Skip to content

Commit

Permalink
Fixed memory leaks in generated code
Browse files Browse the repository at this point in the history
objc_primitive_field.cc generates code that leaks
copied objects. See booyah#6
  • Loading branch information
macdrevx committed Oct 4, 2011
1 parent b805b8e commit 2f04fc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/objc_primitive_field.cc
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ namespace google { namespace protobuf { namespace compiler { namespace objective
printer->Print(variables_,
"if (other.$list_name$.count > 0) {\n"
" if (result.$list_name$ == nil) {\n"
" result.$list_name$ = [other.$list_name$ copyWithZone:[other.$list_name$ zone]];\n"
" result.$list_name$ = [[other.$list_name$ copyWithZone:[other.$list_name$ zone]] autorelease];\n"
" } else {\n"
" [result.$list_name$ appendArray:other.$list_name$];\n"
" }\n"
Expand Down

0 comments on commit 2f04fc6

Please sign in to comment.