Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small leak DiffMatchPatch.m fix #89

Closed
Rjonhson opened this issue Jul 16, 2013 · 1 comment
Closed

Small leak DiffMatchPatch.m fix #89

Rjonhson opened this issue Jul 16, 2013 · 1 comment

Comments

@Rjonhson
Copy link

Line 193, they forgot to autorelease, here is the fix:

newPatch.diffs = [[[NSMutableArray alloc] initWithArray:self.diffs copyItems:YES] autorelease];

@jleandroperez
Copy link
Contributor

@Rjonhson thank you!

dmsnell pushed a commit to dmsnell/diff-match-patch that referenced this issue 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>
samrayner pushed a commit to samrayner/diff-match-patch that referenced this issue 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants