Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid leaking the track grip QPixmap at each paintEvent #5590

Merged
merged 1 commit into from
Jul 24, 2020
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions include/Track.h
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,6 @@ private slots:
void clearTrack();

private:
static QPixmap * s_grip;

TrackView * m_trackView;

QPushButton * m_trackOps;
Expand Down
14 changes: 2 additions & 12 deletions src/core/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"));
}
}

Expand Down