Commit d65ad9ba authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt: kill memleak on the special sound slider

parent 380d2c8c
......@@ -62,13 +62,14 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
if( !b_special )
{
volumeMenu = NULL; subLayout = NULL;
volumeControlWidget = NULL;
}
else
{
/* Special view, click on button shows the slider */
b_shiny = false;
QFrame *volumeControlWidget = new QFrame;
volumeControlWidget = new QFrame;
subLayout = new QVBoxLayout( volumeControlWidget );
subLayout->setLayoutMargins( 4, 4, 4, 4, 4 );
volumeMenu = new QMenu( this );
......@@ -121,6 +122,12 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
CONNECT( THEMIM, volumeChanged( void ), this, updateVolume( void ) );
}
SoundWidget::~SoundWidget()
{
delete volumeSlider;
delete volumeControlWidget;
}
void SoundWidget::updateVolume( int i_sliderVolume )
{
if( !b_my_volume )
......
......@@ -68,11 +68,13 @@ class SoundWidget : public QWidget
public:
SoundWidget( QWidget *parent, intf_thread_t *_p_i, bool,
bool b_special = false );
virtual ~SoundWidget();
private:
intf_thread_t *p_intf;
QLabel *volMuteLabel;
QAbstractSlider *volumeSlider;
QFrame *volumeControlWidget;
bool b_my_volume;
QMenu *volumeMenu;
virtual bool eventFilter( QObject *obj, QEvent *e );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment