Avoid leaking the track grip QPixmap at each paintEvent (#5590)

This commit is contained in:
Stefano Bonicatti
2020-07-24 03:33:46 +02:00
committed by GitHub
parent 04d8c0db06
commit dc3e8cab45
2 changed files with 2 additions and 14 deletions

View File

@@ -459,8 +459,6 @@ private slots:
void clearTrack();
private:
static QPixmap * s_grip;
TrackView * m_trackView;
QPushButton * m_trackOps;

View File

@@ -1830,10 +1830,6 @@ void TrackContentWidget::setEmbossColor( const QBrush & c )
// trackOperationsWidget
// ===========================================================================
QPixmap * TrackOperationsWidget::s_grip = NULL; /*!< grip pixmap */
/*! \brief Create a new trackOperationsWidget
*
* The trackOperationsWidget is the grip and the mute button of a track.
@@ -1960,17 +1956,11 @@ void TrackOperationsWidget::paintEvent( QPaintEvent * pe )
if( m_trackView->isMovingTrack() == false )
{
s_grip = new QPixmap( embed::getIconPixmap(
"track_op_grip" ) );
p.drawPixmap( 2, 2, *s_grip );
p.drawPixmap( 2, 2, embed::getIconPixmap("track_op_grip"));
}
else
{
s_grip = new QPixmap( embed::getIconPixmap(
"track_op_grip_c" ) );
p.drawPixmap( 2, 2, *s_grip );
p.drawPixmap( 2, 2, embed::getIconPixmap("track_op_grip_c"));
}
}