Only join/delete E1.31 keepalive thread if it has actually been created

This commit is contained in:
Adam Honse 2021-05-21 20:43:14 -05:00
parent 1f2d298e14
commit 2afddf9bbf

View file

@ -293,9 +293,13 @@ RGBController_E131::RGBController_E131(std::vector<E131Device> device_list)
RGBController_E131::~RGBController_E131()
{
keepalive_thread_run = 0;
keepalive_thread->join();
delete keepalive_thread;
if(keepalive_thread != nullptr)
{
keepalive_thread_run = 0;
keepalive_thread->join();
delete keepalive_thread;
}
/*---------------------------------------------------------*\
| Delete the matrix map |
\*---------------------------------------------------------*/