* src/sdf/ftsdf.c (sdf_generate_coarse_grid): Memory leak.

Release the allocated lists for the coarse grid after
we are done using them.
This commit is contained in:
Anuj Verma 2020-07-11 10:38:15 +05:30 committed by anujverma
parent 80c5bed575
commit 2afa0cb369
2 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2020-07-11 Anuj Verma <anujv@iitbhilai.ac.in>
* src/sdf/ftsdf.c (sdf_generate_coarse_grid): Memory leak.
Release the allocated lists for the coarse grid after
we are done using them.
2020-07-11 Anuj Verma <anujv@iitbhilai.ac.in>
[sdf] Completed the coarse grid optimization.

View File

@ -45,7 +45,7 @@
/* then they will be checked for corner if they have ambiguity. */
#define CORNER_CHECK_EPSILON 32
#define CG_DIMEN 10
#define CG_DIMEN 8
/**************************************************************************
*
@ -2909,6 +2909,24 @@
}
}
/* release the allocated lists */
for ( i = 0; i < CG_DIMEN * CG_DIMEN; i++ )
{
SDF_Edge* edge = coarse_grid[i];
SDF_Edge* temp;
while ( edge )
{
temp = edge;
edge = edge->next;
sdf_edge_done( memory, &temp );
}
coarse_grid[i] = NULL;
}
Exit:
return error;
}