mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-28 14:18:41 +02:00
Bug2004: Opening Mixer Board with a Note track crashed...
... Just one null check was needed, but I also add another, and use a wxWeakRef pointer, for more safety.
This commit is contained in:
parent
e6e4f44c81
commit
3f928a25b0
@ -668,7 +668,8 @@ void MixerTrackCluster::UpdateMeter(const double t0, const double t1)
|
||||
else if (meterFloatsArray[index] > 1.0)
|
||||
meterFloatsArray[index] = 1.0;
|
||||
|
||||
mMeter->UpdateDisplay(2, nFrames, meterFloatsArray.get());
|
||||
if (mMeter)
|
||||
mMeter->UpdateDisplay(2, nFrames, meterFloatsArray.get());
|
||||
}
|
||||
else
|
||||
this->ResetMeter(false);
|
||||
@ -704,7 +705,8 @@ void MixerTrackCluster::OnPaint(wxPaintEvent & WXUNUSED(event))
|
||||
|
||||
wxColour col = theTheme.Colour(selected ? clrTrackInfoSelected : clrTrackInfo) ;
|
||||
SetBackgroundColour( col );
|
||||
mMeter->SetBackgroundColour( col );
|
||||
if (mMeter)
|
||||
mMeter->SetBackgroundColour( col );
|
||||
mStaticText_TrackName->SetBackgroundColour( col );
|
||||
mSlider_Gain->SetBackgroundColour( col );
|
||||
mSlider_Pan->SetBackgroundColour( col );
|
||||
|
@ -146,7 +146,7 @@ private:
|
||||
#ifdef EXPERIMENTAL_MIDI_OUT
|
||||
MixerTrackSlider* mSlider_Velocity;
|
||||
#endif
|
||||
MeterPanel* mMeter;
|
||||
wxWeakRef<MeterPanel> mMeter;
|
||||
|
||||
public:
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
Loading…
x
Reference in New Issue
Block a user