Skip to content

Commit bd24ac3

Browse files
Fredrik Orderudforderud
authored andcommitted
Replace new with std::make_unique and std::unique_ptr for RAII-based memory mgmt.
1 parent 713eaf3 commit bd24ac3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

hid/firefly/app/firefly.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Module Name:
2323
--*/
2424
#include "luminous.h"
2525
#include <dontuse.h>
26+
#include <memory>
2627

2728
#define USAGE \
2829
_T("Usage: Flicker <-0 | -1 | -2>\n\
@@ -57,7 +58,7 @@ main(
5758
exit(0);
5859
}
5960

60-
CLuminous *luminous = new CLuminous();
61+
auto luminous = std::make_unique<CLuminous>();
6162

6263
if (luminous == NULL) {
6364

@@ -68,7 +69,6 @@ main(
6869
if (!luminous->Open()) {
6970

7071
_tprintf(_T("Problem opening Luminous\n"));
71-
delete(luminous);
7272
return 0;
7373
}
7474

@@ -124,8 +124,6 @@ main(
124124
End:
125125
luminous->Close();
126126

127-
delete(luminous);
128-
129127
return 0;
130128
}
131129

0 commit comments

Comments
 (0)