From bbc154efe2e366012012920f737ebf7183b45e15 Mon Sep 17 00:00:00 2001 From: Tim Zeuner Date: Sun, 15 Jan 2023 22:36:27 +0100 Subject: [PATCH] Bugfix when calling destructor without a running thread --- AutonomousMode/lfr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/AutonomousMode/lfr.cpp b/AutonomousMode/lfr.cpp index c288716..89e1d7f 100644 --- a/AutonomousMode/lfr.cpp +++ b/AutonomousMode/lfr.cpp @@ -19,7 +19,10 @@ LFR::LFR(int videoHeight, int videoWidth, int thresholdBinary, int gaussKernelSi LFR::~LFR() { endLoop(); - thread->join(); + if(thread) + { + thread->join(); + } } void LFR::removeListener(LFR::ListenerKey key)