[sdf -> bsdf] Fixed memory leak.

* src/sdf/ftbsdf.c (bsdf_raster_render): Release the
  allocated distance map.
  Also, added a log of total memory allocated for
  generating SDF from bitmap.
This commit is contained in:
Anuj Verma 2020-08-03 09:13:53 +05:30
parent d7a2e99bb0
commit 95846825f6
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,12 @@
2020-08-3 Anuj Verma <anujv@iitbhilai.ac.in>
[sdf -> bsdf] Fixed memory leak.
* src/sdf/ftbsdf.c (bsdf_raster_render): Release the
allocated distance map.
Also, added a log of total memory allocated for
generating SDF from bitmap.
2020-08-2 Anuj Verma <anujv@iitbhilai.ac.in>
[sdf -> bsdf] Fixed a bug with `finalize_sdf'.

View File

@ -965,7 +965,14 @@
FT_CALL( edt8( &worker ) );
FT_CALL( finalize_sdf( &worker, target ) );
FT_TRACE0(( "[bsdf] bsdf_raster_render: "
"Total memory used = %ld\n",
worker.width * worker.rows * sizeof( *worker.distance_map ) ));
Exit:
if ( worker.distance_map )
FT_FREE( worker.distance_map );
return error;
}