mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +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,16 +394,20 @@ 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
|
||||
|
||||
FloatRect * rcs = new FloatRect[gapc];
|
||||
|
||||
for(x=0;x<gapc;x++)
|
||||
if (gapc > 0)
|
||||
{
|
||||
// gaps are stored as texture (u/v) coordinates
|
||||
rcs[x].width=rcs[x].left=-1.0f;
|
||||
rcs[x].top=(float)gaps[x][0]/(float)h;
|
||||
rcs[x].height=(float)gaps[x][1]/(float)h;
|
||||
FloatRect * rcs = new FloatRect[gapc];
|
||||
|
||||
for (x = 0; x < gapc; x++)
|
||||
{
|
||||
// gaps are stored as texture (u/v) coordinates
|
||||
rcs[x].width = rcs[x].left = -1.0f;
|
||||
rcs[x].top = (float)gaps[x][0] / (float)h;
|
||||
rcs[x].height = (float)gaps[x][1] / (float)h;
|
||||
}
|
||||
gl_info.areas = rcs;
|
||||
}
|
||||
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