Merge pull request #386 from atsampson/valgrind1

Fix some more Valgrind warnings
This commit is contained in:
Volker Fischer 2020-06-21 17:37:22 +02:00 committed by GitHub
commit a3c5d88dfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 58 additions and 6 deletions

View File

@ -704,6 +704,14 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags ) :
connectFaderSignalsToMixerBoardSlots<MAX_NUM_CHANNELS>(); connectFaderSignalsToMixerBoardSlots<MAX_NUM_CHANNELS>();
} }
CAudioMixerBoard::~CAudioMixerBoard()
{
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
{
delete vecpChanFader[i];
}
}
template<unsigned int slotId> template<unsigned int slotId>
inline void CAudioMixerBoard::connectFaderSignalsToMixerBoardSlots() inline void CAudioMixerBoard::connectFaderSignalsToMixerBoardSlots()
{ {

View File

@ -169,6 +169,8 @@ public:
CAudioMixerBoard ( QWidget* parent = nullptr, CAudioMixerBoard ( QWidget* parent = nullptr,
Qt::WindowFlags f = nullptr ); Qt::WindowFlags f = nullptr );
virtual ~CAudioMixerBoard();
void HideAll(); void HideAll();
void ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInfo ); void ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInfo );
void SetServerName ( const QString& strNewServerName ); void SetServerName ( const QString& strNewServerName );

View File

@ -220,6 +220,23 @@ CClient::CClient ( const quint16 iPortNumber,
} }
} }
CClient::~CClient()
{
// free audio encoders and decoders
opus_custom_encoder_destroy ( OpusEncoderMono );
opus_custom_decoder_destroy ( OpusDecoderMono );
opus_custom_encoder_destroy ( OpusEncoderStereo );
opus_custom_decoder_destroy ( OpusDecoderStereo );
opus_custom_encoder_destroy ( Opus64EncoderMono );
opus_custom_decoder_destroy ( Opus64DecoderMono );
opus_custom_encoder_destroy ( Opus64EncoderStereo );
opus_custom_decoder_destroy ( Opus64DecoderStereo );
// free audio modes
opus_custom_mode_destroy ( OpusMode );
opus_custom_mode_destroy ( Opus64Mode );
}
void CClient::OnSendProtMessage ( CVector<uint8_t> vecMessage ) void CClient::OnSendProtMessage ( CVector<uint8_t> vecMessage )
{ {
// the protocol queries me to call the function to send the message // the protocol queries me to call the function to send the message

View File

@ -110,6 +110,8 @@ public:
const bool bNoAutoJackConnect, const bool bNoAutoJackConnect,
const QString& strNClientName ); const QString& strNClientName );
virtual ~CClient();
void Start(); void Start();
void Stop(); void Stop();
bool IsRunning() { return Sound.IsRunning(); } bool IsRunning() { return Sound.IsRunning(); }

View File

@ -37,12 +37,12 @@ CMultiColorLED::CMultiColorLED ( QWidget* parent, Qt::WindowFlags f )
BitmCubeYellow ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDYellowSmall.png" ) ), BitmCubeYellow ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDYellowSmall.png" ) ),
BitmCubeRed ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDRedSmall.png" ) ) BitmCubeRed ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDRedSmall.png" ) )
{ {
// init color flags
Reset();
// set init bitmap // set init bitmap
setPixmap ( BitmCubeGrey ); setPixmap ( BitmCubeGrey );
eColorFlag = RL_GREY; eColorFlag = RL_GREY;
// init color flags
Reset();
} }
void CMultiColorLED::changeEvent ( QEvent* curEvent ) void CMultiColorLED::changeEvent ( QEvent* curEvent )

View File

@ -241,6 +241,7 @@ CServer::CServer ( const int iNewMaxNumChan,
Logging ( iMaxDaysHistory ), Logging ( iMaxDaysHistory ),
iFrameCount ( 0 ), iFrameCount ( 0 ),
JamRecorder ( strRecordingDirName ), JamRecorder ( strRecordingDirName ),
bRecorderInitialised ( false ),
bEnableRecording ( false ), bEnableRecording ( false ),
bWriteStatusHTMLFile ( false ), bWriteStatusHTMLFile ( false ),
HighPrecisionTimer ( bNUseDoubleSystemFrameSize ), HighPrecisionTimer ( bNUseDoubleSystemFrameSize ),
@ -550,6 +551,26 @@ void CServer::CreateAndSendJitBufMessage ( const int iCurChanID,
vecChannels[iCurChanID].CreateJitBufMes ( iNNumFra ); vecChannels[iCurChanID].CreateJitBufMes ( iNNumFra );
} }
CServer::~CServer()
{
for ( int i = 0; i < iMaxNumChannels; i++ )
{
// free audio encoders and decoders
opus_custom_encoder_destroy ( OpusEncoderMono[i] );
opus_custom_decoder_destroy ( OpusDecoderMono[i] );
opus_custom_encoder_destroy ( OpusEncoderStereo[i] );
opus_custom_decoder_destroy ( OpusDecoderStereo[i] );
opus_custom_encoder_destroy ( Opus64EncoderMono[i] );
opus_custom_decoder_destroy ( Opus64DecoderMono[i] );
opus_custom_encoder_destroy ( Opus64EncoderStereo[i] );
opus_custom_decoder_destroy ( Opus64DecoderStereo[i] );
// free audio modes
opus_custom_mode_destroy ( OpusMode[i] );
opus_custom_mode_destroy ( Opus64Mode[i] );
}
}
void CServer::SendProtMessage ( int iChID, CVector<uint8_t> vecMessage ) void CServer::SendProtMessage ( int iChID, CVector<uint8_t> vecMessage )
{ {
// the protocol queries me to call the function to send the message // the protocol queries me to call the function to send the message

View File

@ -183,6 +183,8 @@ public:
const bool bNUseDoubleSystemFrameSize, const bool bNUseDoubleSystemFrameSize,
const ELicenceType eNLicenceType ); const ELicenceType eNLicenceType );
virtual ~CServer();
void Start(); void Start();
void Stop(); void Stop();
bool IsRunning() { return HighPrecisionTimer.isActive(); } bool IsRunning() { return HighPrecisionTimer.isActive(); }

View File

@ -37,6 +37,9 @@ CServerDlg::CServerDlg ( CServer* pNServP,
BitmapSystemTrayInactive ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDGreyArrow.png" ) ), BitmapSystemTrayInactive ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDGreyArrow.png" ) ),
BitmapSystemTrayActive ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDGreenArrow.png" ) ) BitmapSystemTrayActive ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDGreenArrow.png" ) )
{ {
// check if system tray icon can be used
bSystemTrayIconAvaialbe = SystemTrayIcon.isSystemTrayAvailable();
setupUi ( this ); setupUi ( this );
@ -143,9 +146,6 @@ CServerDlg::CServerDlg ( CServer* pNServP,
+ tr ( "During a recording session, the button can be used to start a new recording." ) ); + tr ( "During a recording session, the button can be used to start a new recording." ) );
// check if system tray icon can be used
bSystemTrayIconAvaialbe = SystemTrayIcon.isSystemTrayAvailable();
// init system tray icon // init system tray icon
if ( bSystemTrayIconAvaialbe ) if ( bSystemTrayIconAvaialbe )
{ {