mirror of
https://github.com/LX3JL/xlxd.git
synced 2026-04-04 14:07:31 +00:00
ambed 1.3.3
Corrected bug crashing ambed
This commit is contained in:
parent
640f7c5c9c
commit
f643fc512a
2 changed files with 19 additions and 15 deletions
32
ambed/cstream.cpp
Normal file → Executable file
32
ambed/cstream.cpp
Normal file → Executable file
|
|
@ -71,18 +71,20 @@ CStream::CStream(uint16 uiId, const CCallsign &Callsign, const CIp &Ip, uint8 ui
|
|||
|
||||
CStream::~CStream()
|
||||
{
|
||||
m_Socket.Close();
|
||||
if ( m_VocodecChannel != NULL )
|
||||
{
|
||||
g_Vocodecs.CloseChannel(m_VocodecChannel);
|
||||
m_VocodecChannel = NULL;
|
||||
}
|
||||
|
||||
// stop thread first
|
||||
m_bStopThread = true;
|
||||
if ( m_pThread != NULL )
|
||||
{
|
||||
m_pThread->join();
|
||||
delete m_pThread;
|
||||
m_pThread = NULL;
|
||||
}
|
||||
|
||||
// then close everything
|
||||
m_Socket.Close();
|
||||
if ( m_VocodecChannel != NULL )
|
||||
{
|
||||
m_VocodecChannel->Close();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -134,13 +136,7 @@ bool CStream::Init(uint16 uiPort)
|
|||
|
||||
void CStream::Close(void)
|
||||
{
|
||||
// close everything
|
||||
m_Socket.Close();
|
||||
if ( m_VocodecChannel != NULL )
|
||||
{
|
||||
m_VocodecChannel->Close();
|
||||
}
|
||||
|
||||
// stop thread first
|
||||
m_bStopThread = true;
|
||||
if ( m_pThread != NULL )
|
||||
{
|
||||
|
|
@ -148,6 +144,14 @@ void CStream::Close(void)
|
|||
delete m_pThread;
|
||||
m_pThread = NULL;
|
||||
}
|
||||
|
||||
// then close everything
|
||||
m_Socket.Close();
|
||||
if ( m_VocodecChannel != NULL )
|
||||
{
|
||||
m_VocodecChannel->Close();
|
||||
}
|
||||
|
||||
|
||||
// report
|
||||
std::cout << m_iLostPackets << " of " << m_iTotalPackets << " packets lost" << std::endl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue