← 返回首页
Fix memory leak in Patch in Objective-C version by atdrendel · Pull Request #156 · google/diff-match-patch · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus
This repository was archived by the owner on Aug 5, 2024. It is now read-only.

Fix memory leak in Patch in Objective-C version#156

Open
atdrendel wants to merge 1 commit into
google:masterfrom
atdrendel:patch-1
Open

Fix memory leak in Patch in Objective-C version#156
atdrendel wants to merge 1 commit into
google:masterfrom
atdrendel:patch-1

Conversation

Copy link
Copy Markdown

The NSMutableArray being assigned to Patch.diffs isn't being autoreleased correctly. Since it's being assigned to a synthesized property marked with retain, and the NSMutableArray is being initialized with alloc-init, the array needs to be autoreleased so that it doesn't leak.

The NSMutableArray being assigned to Patch.diffs isn't being autoreleased correctly. Since it's being assigned to a synthesized property marked with retain, and the NSMutableArray is being initialized with alloc-init, the array needs to be autoreleased so that it doesn't leak.

google-cla Bot commented Mar 19, 2024

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

dmsnell pushed a commit to dmsnell/diff-match-patch that referenced this pull request Mar 22, 2024
Resolves google#156. The NSMutableArray being assigned to Patch.diffs isn't being autoreleased correctly. Since it's being assigned to a synthesized property marked with retain, and the NSMutableArray is being initialized with alloc-init, the array needs to be autoreleased so that it doesn't leak. See also Simperium/simperium-ios#89 Authored-by: Anthony Drendel <atdrendel@users.noreply.github.com>

dmsnell commented Mar 22, 2024

Copy link
Copy Markdown

@atdrendel with @jleandroperez' help I found that we applied an identical patch back in 2013

Simperium/simperium-ios@685c16d

Seems to have been working since then. I've applied this to my fork, which I'm trying to maintain now since this repo is hibernating.

dmsnell@5337709

samrayner pushed a commit to samrayner/diff-match-patch that referenced this pull request May 6, 2024
Resolves google/diff-match-patch#156. The NSMutableArray being assigned to Patch.diffs isn't being autoreleased correctly. Since it's being assigned to a synthesized property marked with retain, and the NSMutableArray is being initialized with alloc-init, the array needs to be autoreleased so that it doesn't leak. See also Simperium/simperium-ios#89 Authored-by: Anthony Drendel <atdrendel@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Footer

© 2026 GitHub, Inc.