Skip to content

Commit

Permalink
Fix NSData
Browse files Browse the repository at this point in the history
  • Loading branch information
liamappelbe committed Apr 29, 2024
1 parent 15e246b commit 37fc754
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkgs/objective_c/lib/src/ns_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ extension NSDataListExtension on List<int> {
final buffer = malloc<Uint8>(length);
buffer.asTypedList(length).setAll(0, this);

return NSData.dataWithBytesNoCopy_length_(buffer.cast(), length);
final nsData = NSData.dataWithBytes_length_(buffer.cast(), length);
malloc.free(buffer);

return nsData;
}
}

0 comments on commit 37fc754

Please sign in to comment.