Skip to content

Commit

Permalink
GUI: Use std::make_unique instead of new
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Aug 10, 2020
1 parent 8dd7b01 commit 516fb99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gui/panelpreviewimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void PanelPreviewImage::loadImage() {

_labelDimensions->setText(QString("(%1x%2)").arg(width).arg(height));

std::unique_ptr<byte> rgbaData(new byte[width * height * 4]);
std::unique_ptr<byte[]> rgbaData = std::make_unique<byte[]>(width * height * 4);
std::memset(rgbaData.get(), 0, width * height * 4);

convertImage(*image, rgbaData.get());
Expand Down
2 changes: 1 addition & 1 deletion src/gui/panelpreviewtable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void PanelPreviewTable::setTableData(bool isGDA) {
std::unique_ptr<Common::SeekableReadStream> stream(_currentItem->getResourceData());

if (isGDA) {
std::unique_ptr<Aurora::GDAFile> gda(new Aurora::GDAFile(stream.release()));
std::unique_ptr<Aurora::GDAFile> gda = std::make_unique<Aurora::GDAFile>(stream.release());
twoDA = std::make_unique<Aurora::TwoDAFile>(*gda);
} else {
twoDA = std::make_unique<Aurora::TwoDAFile>(*stream);
Expand Down

0 comments on commit 516fb99

Please sign in to comment.