scanait: another ait segfault fix

Origin commit data
------------------
Branch: ni/coolstream
Commit: 48a03894d1
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2021-10-27 (Wed, 27 Oct 2021)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2021-10-27 21:28:50 +02:00
committed by vanhofen
parent a729938689
commit 2a6f19763c
2 changed files with 12 additions and 5 deletions

View File

@@ -44,6 +44,7 @@ class CAit : public OpenThreads::Thread
private:
int dmxnum;
unsigned short pid;
bool running;
std::string name;
ApplicationInformationSectionList sections;
void run();

View File

@@ -41,6 +41,7 @@ CAit::CAit()
{
dmxnum = 0;
pid = 0;
running = false;
}
void CAit::setDemux(int dnum)
@@ -50,17 +51,22 @@ void CAit::setDemux(int dnum)
bool CAit::Start()
{
if (running)
return false;
running = true;
int ret = start();
return (ret == 0);
}
bool CAit::Stop()
{
if(pid > 0){
int ret = join();
return (ret == 0);
}
return false;
if (!running)
return false;
running = false;
int ret = join();
return (ret == 0);
}
void CAit::run()