mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-22 10:07:44 +00:00
Fix nav_export memory leak. (#650)
* Fix nav_export memory leak. * space
This commit is contained in:
parent
2a98922697
commit
95573810f3
1 changed files with 10 additions and 0 deletions
|
@ -317,7 +317,13 @@ unsigned char* TiledNavmeshGenerator::buildTileMesh( const int tx, const int ty,
|
||||||
const int ncid = rcGetChunksOverlappingRect( m_chunkyMesh, tbmin, tbmax, cid, 512 );
|
const int ncid = rcGetChunksOverlappingRect( m_chunkyMesh, tbmin, tbmax, cid, 512 );
|
||||||
|
|
||||||
if( !ncid )
|
if( !ncid )
|
||||||
|
{
|
||||||
|
rcFreeHeightField( m_solid );
|
||||||
|
m_solid = nullptr;
|
||||||
|
delete[] m_triareas;
|
||||||
|
m_triareas = nullptr;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
m_tileTriCount = 0;
|
m_tileTriCount = 0;
|
||||||
|
|
||||||
|
@ -452,6 +458,10 @@ unsigned char* TiledNavmeshGenerator::buildTileMesh( const int tx, const int ty,
|
||||||
|
|
||||||
if( m_cset->nconts == 0 )
|
if( m_cset->nconts == 0 )
|
||||||
{
|
{
|
||||||
|
rcFreeCompactHeightfield( m_chf );
|
||||||
|
rcFreeContourSet( m_cset );
|
||||||
|
m_chf = nullptr;
|
||||||
|
m_cset = nullptr;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue