From 6f28717f19578a3a7ff3120bb7da4bfc77b97ce8 Mon Sep 17 00:00:00 2001 From: Jan Papesch Date: Fri, 24 Apr 2026 11:23:36 +0200 Subject: [PATCH] Zero-out event threads when they terminate --- src/main/c/Posix/SerialPort_Posix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/c/Posix/SerialPort_Posix.c b/src/main/c/Posix/SerialPort_Posix.c index 7df4073c..ef35e02b 100644 --- a/src/main/c/Posix/SerialPort_Posix.c +++ b/src/main/c/Posix/SerialPort_Posix.c @@ -180,6 +180,7 @@ void* eventReadingThread1(void *serialPortPointer) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldValue); } } + port->eventsThread1 = 0; return NULL; } @@ -236,6 +237,7 @@ void* eventReadingThread2(void *serialPortPointer) pthread_mutex_unlock(&port->eventMutex); pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &oldValue); } + port->eventsThread2 = 0; return NULL; }