From 4228b658af6c8f8b007c8a89b907c2067d693860 Mon Sep 17 00:00:00 2001 From: halx99 Date: Thu, 20 Oct 2022 20:18:32 +0800 Subject: [PATCH] Fix memory leak --- core/renderer/backend/opengl/ProgramGL.cpp | 6 ------ core/renderer/backend/opengl/ProgramGL.h | 1 - 2 files changed, 7 deletions(-) diff --git a/core/renderer/backend/opengl/ProgramGL.cpp b/core/renderer/backend/opengl/ProgramGL.cpp index 3686b20076..ba1b17ad1e 100644 --- a/core/renderer/backend/opengl/ProgramGL.cpp +++ b/core/renderer/backend/opengl/ProgramGL.cpp @@ -72,7 +72,6 @@ ProgramGL::ProgramGL(std::string_view vertexShader, std::string_view fragmentSha EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { this->reloadProgram(); }); Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1); #endif - setupVertexLayout(); } ProgramGL::~ProgramGL() @@ -203,11 +202,6 @@ void ProgramGL::computeLocations() _builtinUniformLocation[Uniform::TEXTURE1].location[0] = location; } -void ProgramGL::setupVertexLayout() -{ - _vertexLayout = new VertexLayout(); -} - bool ProgramGL::getAttributeLocation(std::string_view attributeName, unsigned int& location) const { GLint loc = glGetAttribLocation(_program, attributeName.data()); diff --git a/core/renderer/backend/opengl/ProgramGL.h b/core/renderer/backend/opengl/ProgramGL.h index 2fb0b4a5f8..6a34c8c168 100644 --- a/core/renderer/backend/opengl/ProgramGL.h +++ b/core/renderer/backend/opengl/ProgramGL.h @@ -156,7 +156,6 @@ private: bool getAttributeLocation(std::string_view attributeName, unsigned int& location) const; void computeUniformInfos(); void computeLocations(); - void setupVertexLayout(); #if AX_ENABLE_CACHE_TEXTURE_DATA virtual void reloadProgram(); virtual int getMappedLocation(int location) const override;