Detach frameReceiver after it has been spawned

This commit is contained in:
Aaro Altonen 2019-04-01 12:09:10 +03:00
parent 008107c33f
commit 1552cec1ce
2 changed files with 2 additions and 3 deletions

View File

@ -16,8 +16,6 @@ RTPContext::~RTPContext()
delete it->second;
conns_.erase(it);
}
std::terminate();
}
RTPReader *RTPContext::createReader(std::string srcAddr, int srcPort)

View File

@ -65,7 +65,6 @@ RTPReader::RTPReader(std::string srcAddr, int srcPort):
RTPReader::~RTPReader()
{
active_ = false;
runner_->join();
// TODO how to stop thread???
// private global variable set here from true to false and thread exist???
@ -101,7 +100,9 @@ int RTPReader::start()
active_ = true;
id_ = rtpGetUniqueId();
runner_ = new std::thread(frameReceiver, this);
runner_->detach();
return 0;
}