Skip to content

Commit

Permalink
Replace new with std::make_unique and std::unique_ptr for RAII-based …
Browse files Browse the repository at this point in the history
…memory mgmt.
  • Loading branch information
Fredrik Orderud committed Jan 31, 2024
1 parent a0e23c5 commit 94d9a22
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions hid/firefly/app/firefly.cpp
Expand Up @@ -23,6 +23,7 @@ Module Name:
--*/
#include "luminous.h"
#include <dontuse.h>
#include <memory>

#define USAGE \
_T("Usage: Flicker <-0 | -1 | -2>\n\
Expand Down Expand Up @@ -57,7 +58,7 @@ main(
exit(0);
}

CLuminous *luminous = new CLuminous();
auto luminous = std::make_unique<CLuminous>();

if (luminous == NULL) {

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

_tprintf(_T("Problem opening Luminous\n"));
delete(luminous);
return 0;
}

Expand Down Expand Up @@ -124,8 +124,6 @@ main(
End:
luminous->Close();

delete(luminous);

return 0;
}

Expand Down

0 comments on commit 94d9a22

Please sign in to comment.