Skip to content

Commit

Permalink
CScreensaverFlux: use std::vector for m_fluxes
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Rusak <lorusak@gmail.com>
  • Loading branch information
lrusak committed Apr 21, 2023
1 parent 4680749 commit 34654b0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/flux/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ bool CScreensaverFlux::Start()
m_lumdiff = 1.0f / float(gSettings.dTrail);

// Initialize flux fields
m_fluxes = new CFlux[gSettings.dFluxes];
m_fluxes.resize(gSettings.dFluxes);

glGenBuffers(1, &m_vertexVBO);
glBindBuffer(GL_ARRAY_BUFFER, m_vertexVBO);
Expand Down Expand Up @@ -638,9 +638,6 @@ void CScreensaverFlux::Stop()
#if defined(HAS_GL) || (defined(HAS_GLES) && HAS_GLES == 3)
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
#endif

// Free memory
delete[] m_fluxes;
}

void CScreensaverFlux::Render()
Expand Down
2 changes: 1 addition & 1 deletion src/flux/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class ATTR_DLL_LOCAL CScreensaverFlux

GLuint m_lightingEnabled = 0;

CFlux *m_fluxes;
std::vector<CFlux> m_fluxes;

std::vector<sLight> m_sphereTriangleFan1;
std::vector<sLight> m_sphereTriangleFan2;
Expand Down

0 comments on commit 34654b0

Please sign in to comment.