mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-27 07:43:50 +01:00
Fixes per Vigilant Sentry (http://www.vigilantsw.com/)
* Fix memory leaks. * Add comments about initializations and checking for successful results. * Add checks for NULL deref. * Consistency in "TODO" vs "TO-DO" comments!
This commit is contained in:
@@ -391,6 +391,8 @@ void KeyConfigPrefs::SetKeyForSelected( const wxString & key )
|
||||
|
||||
void KeyConfigPrefs::OnSet(wxCommandEvent & e)
|
||||
{
|
||||
// ANSWER-ME: mCommandSelected is unsigned, so there's no point checking whether it's < 0.
|
||||
// Should it be a signed int instead or remove that check?
|
||||
if (mCommandSelected < 0 || mCommandSelected >= mNames.GetCount())
|
||||
return;
|
||||
|
||||
@@ -414,6 +416,8 @@ void KeyConfigPrefs::OnSet(wxCommandEvent & e)
|
||||
void KeyConfigPrefs::OnClear(wxCommandEvent& event)
|
||||
{
|
||||
mKey->Clear();
|
||||
// ANSWER-ME: mCommandSelected is unsigned, so there's no point checking whether it's < 0.
|
||||
// Should it be a signed int instead or remove that check?
|
||||
if (mCommandSelected < 0 || mCommandSelected >= mNames.GetCount()) {
|
||||
return;
|
||||
}
|
||||
@@ -500,6 +504,8 @@ void KeyConfigPrefs::OnCategory(wxCommandEvent & e)
|
||||
void KeyConfigPrefs::OnItemSelected(wxListEvent & e)
|
||||
{
|
||||
mCommandSelected = e.GetIndex();
|
||||
// ANSWER-ME: mCommandSelected is unsigned, so there's no point checking whether it's < 0.
|
||||
// Should it be a signed int instead or remove that check?
|
||||
if (mCommandSelected < 0 || mCommandSelected >= mNames.GetCount()) {
|
||||
mKey->SetLabel(wxT(""));
|
||||
return;
|
||||
|
||||
@@ -249,7 +249,7 @@ void PrefsDialog::OnOK(wxCommandEvent & event)
|
||||
// set AudioIONotBusyFlag/AudioIOBusyFlag according to monitoring, as well.
|
||||
// Instead allow it because unlike recording, for example, monitoring
|
||||
// is not clearly something that should prohibit opening prefs.
|
||||
// TO-DO: We *could* be smarter in this method and call HandleDeviceChange()
|
||||
// TODO: We *could* be smarter in this method and call HandleDeviceChange()
|
||||
// only when the device choices actually changed. True of lots of prefs!
|
||||
// As is, we always stop monitoring before handling the device change.
|
||||
if (gAudioIO->IsMonitoring())
|
||||
|
||||
Reference in New Issue
Block a user