mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-24 10:14:13 -05:00
UI: Fix leak with paint event of volume slider
This fixes a memory leak introduced in [1] where a new QColor is not balanced by a delete. [1] UI: Update volume meter appearance https://github.com/obsproject/obs-studio/commit/52ae5fc4bd518c67edd8ab94121ace05d9076892 Signed-off-by: pkv <pkv@obsproject.com>
This commit is contained in:
@@ -1557,8 +1557,7 @@ void VolumeSlider::paintEvent(QPaintEvent *event)
|
||||
}
|
||||
|
||||
QPainter painter(this);
|
||||
QColor *tickColor = new QColor;
|
||||
tickColor->setRgb(91, 98, 115, 255);
|
||||
QColor tickColor(91, 98, 115, 255);
|
||||
|
||||
obs_fader_conversion_t fader_db_to_def = obs_fader_db_to_def(fad);
|
||||
|
||||
@@ -1584,7 +1583,7 @@ void VolumeSlider::paintEvent(QPaintEvent *event)
|
||||
|
||||
float xPos = groove.left() + (tickValue * sliderWidth) +
|
||||
(handle.width() / 2);
|
||||
painter.fillRect(xPos, yPos, 1, tickLength, *tickColor);
|
||||
painter.fillRect(xPos, yPos, 1, tickLength, tickColor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1603,7 +1602,7 @@ void VolumeSlider::paintEvent(QPaintEvent *event)
|
||||
float yPos = groove.height() + groove.top() -
|
||||
(tickValue * sliderHeight) -
|
||||
(handle.height() / 2);
|
||||
painter.fillRect(xPos, yPos, tickLength, 1, *tickColor);
|
||||
painter.fillRect(xPos, yPos, tickLength, 1, tickColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user