1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-26 22:51:21 +01:00

Manage the members of CommandOutputTarget with smart pointers

This commit is contained in:
Paul Licameli
2016-03-31 13:12:04 -04:00
parent e8ad90b3c9
commit 3481e678ea
6 changed files with 21 additions and 37 deletions

View File

@@ -257,9 +257,9 @@ std::unique_ptr<ScreenshotCommand> ScreenFrame::CreateCommand()
{
wxASSERT(mStatus != NULL);
auto output =
std::make_unique<CommandOutputTarget>(new NullProgressTarget(),
new StatusBarTarget(*mStatus),
new MessageBoxTarget());
std::make_unique<CommandOutputTarget>(std::make_unique<NullProgressTarget>(),
std::make_shared<StatusBarTarget>(*mStatus),
std::make_shared<MessageBoxTarget>());
CommandType *type = CommandDirectory::Get()->LookUp(wxT("Screenshot"));
wxASSERT_MSG(type != NULL, wxT("Screenshot command doesn't exist!"));
return std::make_unique<ScreenshotCommand>(*type, std::move(output), this);