mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- fixed a few memory leaks.
This commit is contained in:
parent
72101473d0
commit
7f3e18a6cc
4 changed files with 19 additions and 23 deletions
|
@ -483,7 +483,7 @@ FTextureID gl_GetSpriteFrame(unsigned sprite, int frame, int rot, angle_t ang, b
|
|||
|
||||
//==========================================================================
|
||||
//
|
||||
// Recalculate all heights affectting this vertex.
|
||||
// Recalculate all heights affecting this vertex.
|
||||
//
|
||||
//==========================================================================
|
||||
void gl_RecalcVertexHeights(vertex_t * v)
|
||||
|
|
|
@ -623,20 +623,6 @@ void gl_CleanLevelData()
|
|||
mo=next;
|
||||
}
|
||||
|
||||
for(auto &v : level.vertexes) if (v.numsectors > 0)
|
||||
{
|
||||
if (v.sectors != nullptr)
|
||||
{
|
||||
delete [] v.sectors;
|
||||
v.sectors = nullptr;
|
||||
}
|
||||
if (v.heightlist != nullptr)
|
||||
{
|
||||
delete [] v.heightlist;
|
||||
v.heightlist = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (level.sides.Size() > 0 && level.sides[0].segs)
|
||||
{
|
||||
delete [] level.sides[0].segs;
|
||||
|
|
|
@ -394,6 +394,8 @@ bool FTexture::FindHoles(const unsigned char * buffer, int w, int h)
|
|||
}
|
||||
if (startdraw==0 && lendraw==h) return false; // nothing saved so don't create a split list
|
||||
|
||||
if (gapc > 0)
|
||||
{
|
||||
FloatRect * rcs = new FloatRect[gapc];
|
||||
|
||||
for (x = 0; x < gapc; x++)
|
||||
|
@ -404,6 +406,8 @@ bool FTexture::FindHoles(const unsigned char * buffer, int w, int h)
|
|||
rcs[x].height = (float)gaps[x][1] / (float)h;
|
||||
}
|
||||
gl_info.areas = rcs;
|
||||
}
|
||||
else gl_info.areas = nullptr;
|
||||
gl_info.areacount=gapc;
|
||||
|
||||
return true;
|
||||
|
|
|
@ -157,6 +157,12 @@ struct vertex_t
|
|||
heightlist = NULL;
|
||||
}
|
||||
|
||||
~vertex_t()
|
||||
{
|
||||
if (sectors != nullptr) delete[] sectors;
|
||||
if (heightlist != nullptr) delete[] heightlist;
|
||||
}
|
||||
|
||||
bool operator== (const vertex_t &other)
|
||||
{
|
||||
return p == other.p;
|
||||
|
|
Loading…
Reference in a new issue