Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
[linux] use unique_ptr for CTechnique in s_device.*
Browse files Browse the repository at this point in the history
  • Loading branch information
q4a committed Jun 6, 2022
1 parent 1d4a168 commit c3d1dcb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/libs/renderer/src/s_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ bool DX9RENDER::Init()
#ifdef _WIN32 // Effects
RecompileEffects();
#else
pTechnique = new CTechnique(this);
pTechnique = std::make_unique<CTechnique>(this);
pTechnique->DecodeFiles();
#endif

Expand Down Expand Up @@ -2647,8 +2647,7 @@ void DX9RENDER::RestoreRender()
#ifdef _WIN32 // Effects
RecompileEffects();
#else
STORM_DELETE(pTechnique);
pTechnique = new CTechnique(this);
pTechnique = std::make_unique<CTechnique>(this);
pTechnique->DecodeFiles();
#endif

Expand Down Expand Up @@ -2764,8 +2763,7 @@ void DX9RENDER::RunStart()
#ifdef _WIN32 // Effects
RecompileEffects();
#else
STORM_DELETE(pTechnique);
pTechnique = new CTechnique(this);
pTechnique = std::make_unique<CTechnique>(this);
pTechnique->DecodeFiles();
#endif
InvokeEntitiesRestoreRender();
Expand Down
2 changes: 1 addition & 1 deletion src/libs/renderer/src/s_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ class DX9RENDER : public VDX9RENDER
#ifdef _WIN32 // Effects
Effects effects_;
#else
CTechnique *pTechnique;
std::unique_ptr<CTechnique> pTechnique;
#endif

char *fontIniFileName;
Expand Down

0 comments on commit c3d1dcb

Please sign in to comment.