Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/linux_serial/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.3+8

- **FIX**: null value assignment in `PlatformInterface.close`.

## 0.2.3+7

- **FIX**: deprecated use of `dart:ffi` `Pointer.elementAt`. ([0a3213e5](https://github.com/ardera/flutter_packages/commit/0a3213e501c0dbf13667ab1aa6ea4fd635c0ee95))
Expand Down
6 changes: 3 additions & 3 deletions packages/linux_serial/lib/src/linux_serial.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class PlatformInterface {
final int epollFd;
final Stream<List<int>> onFdReady;
final Map<int, ffi.Pointer<epoll_event>?> _epollEventForFd = <int, ffi.Pointer<epoll_event>>{};
final Map<int, Computer?> _computerForFd = <int, Computer>{};
final Map<int, Computer> _computerForFd = <int, Computer>{};

static PlatformInterface? _instance;

Expand Down Expand Up @@ -414,15 +414,15 @@ class PlatformInterface {
assert(_epollEventForFd[fd] != null);
assert(_computerForFd[fd] != null);
_computerForFd[fd]!.turnOff();
_computerForFd[fd] = null;
_computerForFd.remove(fd);

final result = libc.close(fd);
if (result < 0) {
throw OSError("Could not close serial port fd. (close)");
}

ffi.calloc.free(_epollEventForFd[fd]!);
_epollEventForFd[fd] = null;
_epollEventForFd.remove(fd);
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/linux_serial/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: linux_serial
description: Dart package for accessing serial ports on Linux using dart:ffi.
version: 0.2.3+7
version: 0.2.3+8
homepage: https://ardera.dev
repository: https://github.com/ardera/flutter_packages

Expand Down