Skip to content

Fix memory leaks in repeated field and enum list handling.#2790

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_937893270
Open

Fix memory leaks in repeated field and enum list handling.#2790
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_937893270

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Jun 25, 2026

Copy link
Copy Markdown

Fix memory leaks in repeated field and enum list handling.

Add AUTORELEASE to the result of CGPNewRepeatedEnumValueFieldList and RELEASE_ to the list parameter in CGPRepeatedFieldListToNSArray to prevent memory leaks.

The CGPNewRepeatedFieldList allocates the list without the autorelease, returning a retained object. Here the CGPNewRepeatedEnumValueFieldList returns a retained object and the caller is responsible for releasing.

Add AUTORELEASE to the result of CGPNewRepeatedEnumValueFieldList and RELEASE_ to the list parameter in CGPRepeatedFieldListToNSArray to prevent memory leaks.

The CGPNewRepeatedFieldList allocates the list without the autorelease, returning a retained object. Here the CGPNewRepeatedEnumValueFieldList returns a retained object and the caller is responsible for releasing.

PiperOrigin-RevId: 937893270
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant