Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -856,9 +856,9 @@ void CClientDlg::OnChatTextReceived ( QString strChatText )
{
if ( pSettings->bEnableAudioAlerts )
{
QSoundEffect* sf = new QSoundEffect();
sf->setSource ( QUrl::fromLocalFile ( ":sounds/res/sounds/new_message.wav" ) );
sf->play();
QSoundEffect sf;
sf.setSource ( QUrl::fromLocalFile ( ":sounds/res/sounds/new_message.wav" ) );
sf.play();
Comment on lines +859 to +861
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be valid. Stack vs heap allocation?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-> memory leak

}
ChatDlg.AddChatText ( strChatText );

Expand Down Expand Up @@ -907,7 +907,14 @@ void CClientDlg::OnNumClientsChanged ( int iNewNumClients )
{
if ( pSettings->bEnableAudioAlerts && iNewNumClients > iClients )
{
QSoundEffect* sf = new QSoundEffect();
QSoundEffect* sf = new QSoundEffect ( this );
connect ( sf, &QSoundEffect::playingChanged, this, [sf]()
{
if ( !sf->isPlaying() )
{
sf->deleteLater();
}
} );
sf->setSource ( QUrl::fromLocalFile ( ":sounds/res/sounds/new_user.wav" ) );
sf->play();
}
Expand Down Expand Up @@ -1440,13 +1447,13 @@ void CClientDlg::SetMeterStyle ( const EMeterStyle eNewMeterStyle )
break;

case MT_BAR_NARROW:
lbrInputLevelL->SetLevelMeterType ( CLevelMeter::MT_BAR_WIDE );
lbrInputLevelR->SetLevelMeterType ( CLevelMeter::MT_BAR_WIDE );
lbrInputLevelL->SetLevelMeterType ( CLevelMeter::MT_BAR_NARROW );
lbrInputLevelR->SetLevelMeterType ( CLevelMeter::MT_BAR_NARROW );
break;

case MT_LED_ROUND_SMALL:
lbrInputLevelL->SetLevelMeterType ( CLevelMeter::MT_LED_ROUND_BIG );
lbrInputLevelR->SetLevelMeterType ( CLevelMeter::MT_LED_ROUND_BIG );
lbrInputLevelL->SetLevelMeterType ( CLevelMeter::MT_LED_ROUND_SMALL );
lbrInputLevelR->SetLevelMeterType ( CLevelMeter::MT_LED_ROUND_SMALL );
break;
}
Comment on lines 1449 to 1458
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unsure about those.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Expand Down
Loading