mirror of https://github.com/axmolengine/axmol.git
Fix memory leak
This commit is contained in:
parent
154009da5f
commit
4228b658af
|
@ -72,7 +72,6 @@ ProgramGL::ProgramGL(std::string_view vertexShader, std::string_view fragmentSha
|
||||||
EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { this->reloadProgram(); });
|
EventListenerCustom::create(EVENT_RENDERER_RECREATED, [this](EventCustom*) { this->reloadProgram(); });
|
||||||
Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1);
|
Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, -1);
|
||||||
#endif
|
#endif
|
||||||
setupVertexLayout();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProgramGL::~ProgramGL()
|
ProgramGL::~ProgramGL()
|
||||||
|
@ -203,11 +202,6 @@ void ProgramGL::computeLocations()
|
||||||
_builtinUniformLocation[Uniform::TEXTURE1].location[0] = location;
|
_builtinUniformLocation[Uniform::TEXTURE1].location[0] = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ProgramGL::setupVertexLayout()
|
|
||||||
{
|
|
||||||
_vertexLayout = new VertexLayout();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ProgramGL::getAttributeLocation(std::string_view attributeName, unsigned int& location) const
|
bool ProgramGL::getAttributeLocation(std::string_view attributeName, unsigned int& location) const
|
||||||
{
|
{
|
||||||
GLint loc = glGetAttribLocation(_program, attributeName.data());
|
GLint loc = glGetAttribLocation(_program, attributeName.data());
|
||||||
|
|
|
@ -156,7 +156,6 @@ private:
|
||||||
bool getAttributeLocation(std::string_view attributeName, unsigned int& location) const;
|
bool getAttributeLocation(std::string_view attributeName, unsigned int& location) const;
|
||||||
void computeUniformInfos();
|
void computeUniformInfos();
|
||||||
void computeLocations();
|
void computeLocations();
|
||||||
void setupVertexLayout();
|
|
||||||
#if AX_ENABLE_CACHE_TEXTURE_DATA
|
#if AX_ENABLE_CACHE_TEXTURE_DATA
|
||||||
virtual void reloadProgram();
|
virtual void reloadProgram();
|
||||||
virtual int getMappedLocation(int location) const override;
|
virtual int getMappedLocation(int location) const override;
|
||||||
|
|
Loading…
Reference in New Issue