Skip to content

Commit

Permalink
[Foundation] Fix memory leak in NSArray.ArrayFromHandle<T> (#21749)
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne authored Dec 4, 2024
1 parent c4981a6 commit 803d0fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Foundation/NSArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ static public T [] ArrayFromHandle<T> (NativeHandle handle, Converter<NativeHand
static public T [] ArrayFromHandle<T> (NativeHandle handle, Converter<NativeHandle, T> creator, bool releaseHandle)
{
var rv = ArrayFromHandle<T> (handle, creator);
if (releaseHandle && handle == NativeHandle.Zero)
if (releaseHandle && handle != NativeHandle.Zero)
NSObject.DangerousRelease (handle);
return rv;
}
Expand Down

9 comments on commit 803d0fd

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.