1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 07:13:49 +01:00

Throw by value, catch by reference: don't use pointers...

... that's what the better books on C++ recommend.
This commit is contained in:
Paul Licameli
2016-02-14 04:35:05 -05:00
parent 7c4c45a0d5
commit 6052b5f9be
7 changed files with 17 additions and 32 deletions

View File

@@ -384,13 +384,11 @@ void KeyConfigPrefs::OnExport(wxCommandEvent & WXUNUSED(event))
mManager->WriteXML(prefFile);
prefFile.Close();
}
catch (XMLFileWriterException* pException)
catch (const XMLFileWriterException &)
{
wxMessageBox(_("Couldn't write to file: ") + file,
_("Error Exporting Keyboard Shortcuts"),
wxOK | wxCENTRE, this);
delete pException;
}
}
@@ -967,13 +965,11 @@ void KeyConfigPrefs::OnExport(wxCommandEvent & WXUNUSED(event))
mManager->WriteXML(prefFile);
prefFile.Close();
}
catch (XMLFileWriterException* pException)
catch (const XMLFileWriterException &)
{
wxMessageBox(_("Couldn't write to file: ") + file,
_("Error Exporting Keyboard Shortcuts"),
wxOK | wxCENTRE, this);
delete pException;
}
}