1
0
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:
James Crook 2015-05-02 10:59:09 +01:00
commit e55e91c5a1
5 changed files with 9 additions and 11 deletions

View File

@ -486,13 +486,13 @@ void ModuleManager::UnloadModule(ModuleInterface *module)
{ {
module->Terminate(); module->Terminate();
delete module;
if (mLibs.find(module) != mLibs.end()) if (mLibs.find(module) != mLibs.end())
{ {
mLibs[module]->Unload(); mLibs[module]->Unload();
mLibs.erase(module); mLibs.erase(module);
} }
delete module; //After terminating and unloading, we can safely delete the module
} }
} }

View File

@ -251,16 +251,10 @@ EffectEqualization::EffectEqualization()
mCurve = NULL; mCurve = NULL;
mDirty = false; mDirty = false;
mDisallowCustom = false;
// Load the EQ curves // Load the EQ curves
LoadCurves(); 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 // Note: initial curve is set in TransferDataToWindow

View File

@ -212,7 +212,6 @@ private:
double mEQVals[NUMBER_OF_BANDS+1]; double mEQVals[NUMBER_OF_BANDS+1];
EQCurveArray mCurves; EQCurveArray mCurves;
EQCurve mCustomBackup;
Envelope *mLogEnvelope; Envelope *mLogEnvelope;
Envelope *mLinEnvelope; Envelope *mLinEnvelope;

View File

@ -97,6 +97,9 @@ KeyView::KeyView(wxWindow *parent,
// The default view // The default view
mViewType = ViewByTree; mViewType = ViewByTree;
// Calculate measurements used for columns and scrolling
RecalcExtents();
} }
KeyView::~KeyView() KeyView::~KeyView()

View File

@ -565,9 +565,11 @@ NumericConverter::NumericConverter(Type type,
mFocusedDigit = 0; mFocusedDigit = 0;
mValue = value; // used in SetSampleRate, reassigned later
SetSampleRate(sampleRate); SetSampleRate(sampleRate);
SetFormatName(formatName); SetFormatName(formatName);
SetValue(value); SetValue(value); // mValue got overridden to -1 in ControlsToValue(), reassign
} }
void NumericConverter::ParseFormatString( const wxString & format) void NumericConverter::ParseFormatString( const wxString & format)