Commit a863be59 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: SeekSlider: SeekStyle: fix memleak

parent 934eee8c
......@@ -62,6 +62,7 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static )
chapters = NULL;
mHandleLength = -1;
b_seekable = true;
alternativeStyle = NULL;
// prepare some static colors
QPalette p = palette();
......@@ -111,7 +112,10 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static )
/* Use the new/classic style */
if( !b_classic )
setStyle( new SeekStyle );
{
alternativeStyle = new SeekStyle;
setStyle( alternativeStyle );
}
/* Init to 0 */
setPosition( -1.0, 0, 0 );
......@@ -135,6 +139,8 @@ SeekSlider::SeekSlider( Qt::Orientation q, QWidget *_parent, bool _static )
SeekSlider::~SeekSlider()
{
delete chapters;
if ( alternativeStyle )
delete alternativeStyle;
}
/***
......
......@@ -46,6 +46,7 @@ class QTimer;
class SeekPoints;
class QPropertyAnimation;
class QStyleOption;
class QCommonStyle;
/* Input Slider derived from QSlider */
class SeekSlider : public QSlider
......@@ -96,6 +97,8 @@ private:
QColor tickpointForeground;
QColor shadowDark;
QColor shadowLight;
QCommonStyle *alternativeStyle;
/* Handle's animation */
qreal mHandleOpacity;
QPropertyAnimation *animHandle;
......
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