Skip to content

Commit 2e785d3

Browse files
authored
fix: serialcommunication stop (#1061)
* fix: update Stop method to clear data reception handler * also fix the destructor
1 parent 4de1566 commit 2e785d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hal/interfaces/SerialCommunication.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace hal
1919

2020
BufferedSerialCommunicationOnUnbuffered::~BufferedSerialCommunicationOnUnbuffered()
2121
{
22-
delegate.ReceiveData([](infra::ConstByteRange) {});
22+
delegate.ReceiveData(nullptr);
2323
}
2424

2525
void BufferedSerialCommunicationOnUnbuffered::SendData(infra::ConstByteRange data, infra::Function<void()> actionOnCompletion)
@@ -40,7 +40,7 @@ namespace hal
4040

4141
void BufferedSerialCommunicationOnUnbuffered::Stop(const infra::Function<void()>& onDone)
4242
{
43-
delegate.ReceiveData([](infra::ConstByteRange) {});
43+
delegate.ReceiveData(nullptr);
4444
scheduler.Schedule(onDone);
4545
}
4646

0 commit comments

Comments
 (0)