summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnuj Verma <anujv@iitbhilai.ac.in>2020-08-03 09:13:53 +0530
committerAnuj Verma <anujv@iitbhilai.ac.in>2020-08-03 09:13:53 +0530
commit95846825f627276eb670a2d1bc168dbf1a7f9584 (patch)
treecbf9919d0601b943e21d455d31f3342a3762050c
parentd7a2e99bb0a2ff3eaca3ec397ab38f310e7131dc (diff)
downloadfreetype2-95846825f627276eb670a2d1bc168dbf1a7f9584.tar.gz
[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.
-rw-r--r--[GSoC]ChangeLog9
-rw-r--r--src/sdf/ftbsdf.c7
2 files changed, 16 insertions, 0 deletions
diff --git a/[GSoC]ChangeLog b/[GSoC]ChangeLog
index 05f202c5e..b67ea822b 100644
--- a/[GSoC]ChangeLog
+++ b/[GSoC]ChangeLog
@@ -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'.
diff --git a/src/sdf/ftbsdf.c b/src/sdf/ftbsdf.c
index d70c9be1d..1a9c84d91 100644
--- a/src/sdf/ftbsdf.c
+++ b/src/sdf/ftbsdf.c
@@ -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;
}