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

Fix memory leaks #6879

Merged
merged 40 commits into from
Nov 19, 2023
Merged
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cabb9f3
Replace knobFModel with std::vector
sakertooth Sep 20, 2023
cb44295
Create QPixmap's on the stack
sakertooth Sep 20, 2023
35b728b
Assign parent for QGraphicsScene
sakertooth Sep 21, 2023
c52553b
Do not allocate QList on the heap
sakertooth Sep 21, 2023
96745ef
Use static QPixmap's
sakertooth Sep 21, 2023
df8d261
Clear m_vi2->knobFModel in destructor
sakertooth Sep 21, 2023
ab1c7f4
Use local static QPixmap's
sakertooth Sep 22, 2023
7ea957d
Do not allocate QPixmap with new in AudioFileProcessor
sakertooth Sep 22, 2023
4ac9170
Do not allocate QPixmap with new in Nes
sakertooth Sep 22, 2023
95f3566
Do not allocate QPixmap with new in Organic
sakertooth Sep 22, 2023
3c6b8c0
Do not allocate QPixmap with new in SaControlsDialog
sakertooth Sep 22, 2023
9e830c3
Do not allocate QPixmap with new in Vestige
sakertooth Sep 22, 2023
50e5707
Do not allocate QPixmap with new for FileBrowser
sakertooth Sep 22, 2023
fb055c2
Do not allocate QPixmap with new in MixerLine
sakertooth Sep 22, 2023
f539b6a
Do not allocate QPixmap with new in SendButtonIndicator
sakertooth Sep 22, 2023
d11ad5d
Do not allocate QPixmap with new in AutomationClipView
sakertooth Sep 22, 2023
155757f
Do not allocate QPixmap with new in MidiClipView
sakertooth Sep 22, 2023
65689f5
Do not allocate QPixmap with new in AutomationEditor
sakertooth Sep 22, 2023
8382629
Do not allocate QPixmap with new in PianoRoll
sakertooth Sep 22, 2023
55bc30e
Do not allocate QPixmap with new in TimeLineWidget
sakertooth Sep 22, 2023
405bec7
Do not allocate QPixmap with new in EnvelopeAndLfoView
sakertooth Sep 22, 2023
1ee56a6
Do not allocate QPixmap with new in PianoView
sakertooth Sep 22, 2023
54b7867
Do not allocate QPixmap with new in ComboBox
sakertooth Sep 22, 2023
bec3f7a
Do not allocate QPixmap with new in Fader
sakertooth Sep 22, 2023
7100051
Do not allocate QPixmap with new for LcdWidget
sakertooth Sep 22, 2023
27ada30
Do not allocate QPixmap with new for LedCheckbox
sakertooth Sep 22, 2023
4be08f2
Use m_ as prefix for members
sakertooth Sep 22, 2023
2e4f96f
Use uniform initialization
sakertooth Sep 22, 2023
b6e18b9
Merge remote-tracking branch 'upstream/master' into fix-memory-leaks
sakertooth Oct 21, 2023
e7de399
Uniform initiaization
sakertooth Oct 21, 2023
b4a67fa
And then he realized he was making copies...
sakertooth Oct 21, 2023
932ebe9
Do not call QPixmap copy constructor
sakertooth Oct 21, 2023
905bb64
Do not call QPixmap copy constructor in SaControlsDialog
sakertooth Oct 21, 2023
6852512
Do not make pixmap's static for Lcd's and Led's
sakertooth Nov 6, 2023
1389716
Initialize pixmaps in-class
sakertooth Nov 10, 2023
13f46da
Merge remote-tracking branch 'upstream/master' into fix-memory-leaks
sakertooth Nov 10, 2023
d4b106a
Fix few mistakes and formatting
sakertooth Nov 10, 2023
ddd869a
Merge remote-tracking branch 'upstream/master' into fix-memory-leaks
sakertooth Nov 11, 2023
76c8005
Merge remote-tracking branch 'upstream/master' into fix-memory-leaks
sakertooth Nov 19, 2023
5d20868
Merge remote-tracking branch 'upstream/master' into fix-memory-leaks
sakertooth Nov 19, 2023
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
Prev Previous commit
Next Next commit
Do not allocate QPixmap with new in AudioFileProcessor
sakertooth committed Sep 22, 2023
commit 7ea957d33abacedf3c7c4028f950d97aca3572f2
10 changes: 2 additions & 8 deletions plugins/AudioFileProcessor/AudioFileProcessor.cpp
Original file line number Diff line number Diff line change
@@ -439,19 +439,12 @@ namespace gui
{


QPixmap * AudioFileProcessorView::s_artwork = nullptr;


AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
QWidget * _parent ) :
InstrumentViewFixedSize( _instrument, _parent )
{
if( s_artwork == nullptr )
{
s_artwork = new QPixmap( PLUGIN_NAME::getIconPixmap(
"artwork" ) );
}

m_openAudioFileButton = new PixmapButton( this );
m_openAudioFileButton->setCursor( QCursor( Qt::PointingHandCursor ) );
m_openAudioFileButton->move( 227, 72 );
@@ -637,7 +630,8 @@ void AudioFileProcessorView::paintEvent( QPaintEvent * )
{
QPainter p( this );

p.drawPixmap( 0, 0, *s_artwork );
static auto s_artwork = QPixmap{PLUGIN_NAME::getIconPixmap("artwork")};
p.drawPixmap(0, 0, s_artwork);

auto a = castModel<AudioFileProcessor>();

1 change: 0 additions & 1 deletion plugins/AudioFileProcessor/AudioFileProcessor.h
Original file line number Diff line number Diff line change
@@ -145,7 +145,6 @@ protected slots:
private:
virtual void modelChanged();

static QPixmap * s_artwork;

AudioFileProcessorWaveView * m_waveView;
Knob * m_ampKnob;