From e2c9bdb94d5259cbe4904956c08afa5d79b3c5d5 Mon Sep 17 00:00:00 2001 From: Fredrik Orderud Date: Thu, 15 Jun 2023 09:45:43 +0200 Subject: [PATCH] Replace new with std::make_unique and std::unique_ptr for RAII-based memory mgmt. --- hid/firefly/app/firefly.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hid/firefly/app/firefly.cpp b/hid/firefly/app/firefly.cpp index ee761ba83..0951745d2 100644 --- a/hid/firefly/app/firefly.cpp +++ b/hid/firefly/app/firefly.cpp @@ -23,6 +23,7 @@ Module Name: --*/ #include "luminous.h" #include +#include #define USAGE \ _T("Usage: Flicker <-0 | -1 | -2>\n\ @@ -57,7 +58,7 @@ main( exit(0); } - CLuminous *luminous = new CLuminous(); + auto luminous = std::make_unique(); if (luminous == NULL) { @@ -68,7 +69,6 @@ main( if (!luminous->Open()) { _tprintf(_T("Problem opening Luminous\n")); - delete(luminous); return 0; } @@ -124,8 +124,6 @@ main( End: luminous->Close(); - delete(luminous); - return 0; }