1
0
mirror of https://github.com/ShaYmez/xlxd.git synced 2025-09-04 06:07:53 -04:00

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() CStream::~CStream()
{ {
m_Socket.Close(); // stop thread first
if ( m_VocodecChannel != NULL )
{
g_Vocodecs.CloseChannel(m_VocodecChannel);
m_VocodecChannel = NULL;
}
m_bStopThread = true; m_bStopThread = true;
if ( m_pThread != NULL ) if ( m_pThread != NULL )
{ {
m_pThread->join(); m_pThread->join();
delete m_pThread; 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) void CStream::Close(void)
{ {
// close everything // stop thread first
m_Socket.Close();
if ( m_VocodecChannel != NULL )
{
m_VocodecChannel->Close();
}
m_bStopThread = true; m_bStopThread = true;
if ( m_pThread != NULL ) if ( m_pThread != NULL )
{ {
@ -148,6 +144,14 @@ void CStream::Close(void)
delete m_pThread; delete m_pThread;
m_pThread = NULL; m_pThread = NULL;
} }
// then close everything
m_Socket.Close();
if ( m_VocodecChannel != NULL )
{
m_VocodecChannel->Close();
}
// report // report
std::cout << m_iLostPackets << " of " << m_iTotalPackets << " packets lost" << std::endl; 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_MAJOR 1
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_REVISION 2 #define VERSION_REVISION 3
// global ------------------------------------------------------ // global ------------------------------------------------------