ambed 1.3.3

Corrected bug crashing ambed
This commit is contained in:
LX3JL 2019-03-16 18:53:31 +01:00
parent 640f7c5c9c
commit f643fc512a
2 changed files with 19 additions and 15 deletions

32
ambed/cstream.cpp Normal file → Executable file
View 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;

2
ambed/main.h Normal file → Executable file
View File

@ -49,7 +49,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 2
#define VERSION_REVISION 3
// global ------------------------------------------------------