mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-18 17:10:05 +02:00
Merge pull request #39 from DanWin/fix_uninitialized_variables
Fix uninitialized variables, a referencing after delete and some dead code removal, all found by Valgrind and cppcheck.
This commit is contained in:
commit
e55e91c5a1
@ -486,13 +486,13 @@ void ModuleManager::UnloadModule(ModuleInterface *module)
|
||||
{
|
||||
module->Terminate();
|
||||
|
||||
delete module;
|
||||
|
||||
if (mLibs.find(module) != mLibs.end())
|
||||
{
|
||||
mLibs[module]->Unload();
|
||||
mLibs.erase(module);
|
||||
}
|
||||
|
||||
delete module; //After terminating and unloading, we can safely delete the module
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -251,16 +251,10 @@ EffectEqualization::EffectEqualization()
|
||||
|
||||
mCurve = NULL;
|
||||
mDirty = false;
|
||||
mDisallowCustom = false;
|
||||
|
||||
// Load the EQ curves
|
||||
LoadCurves();
|
||||
if (mDisallowCustom)
|
||||
{
|
||||
mCustomBackup.Name = wxT("unnamed");
|
||||
EQCurve &realCustom = mCurves[mCurves.GetCount()-1];
|
||||
wxASSERT(realCustom.Name.IsSameAs(wxT("unnamed")));
|
||||
mCustomBackup.points = realCustom.points;
|
||||
}
|
||||
|
||||
// Note: initial curve is set in TransferDataToWindow
|
||||
|
||||
|
@ -212,7 +212,6 @@ private:
|
||||
double mEQVals[NUMBER_OF_BANDS+1];
|
||||
|
||||
EQCurveArray mCurves;
|
||||
EQCurve mCustomBackup;
|
||||
|
||||
Envelope *mLogEnvelope;
|
||||
Envelope *mLinEnvelope;
|
||||
|
@ -97,6 +97,9 @@ KeyView::KeyView(wxWindow *parent,
|
||||
|
||||
// The default view
|
||||
mViewType = ViewByTree;
|
||||
|
||||
// Calculate measurements used for columns and scrolling
|
||||
RecalcExtents();
|
||||
}
|
||||
|
||||
KeyView::~KeyView()
|
||||
|
@ -565,9 +565,11 @@ NumericConverter::NumericConverter(Type type,
|
||||
|
||||
mFocusedDigit = 0;
|
||||
|
||||
mValue = value; // used in SetSampleRate, reassigned later
|
||||
|
||||
SetSampleRate(sampleRate);
|
||||
SetFormatName(formatName);
|
||||
SetValue(value);
|
||||
SetValue(value); // mValue got overridden to -1 in ControlsToValue(), reassign
|
||||
}
|
||||
|
||||
void NumericConverter::ParseFormatString( const wxString & format)
|
||||
|
Loading…
x
Reference in New Issue
Block a user