Skip to content

Commit

Permalink
Fix #76, in which Valgrind reports a leaked FontConfig object in sndf…
Browse files Browse the repository at this point in the history
…ile-spectrogram

Certain FontConfig objects indirectly referenced via the Cairo static
data are referenced by integer offsets rather than by pointers, so they
appear lost to Valgrind unless we call cairo_debug_reset_static_data().
  • Loading branch information
musicinmybrain authored and evpobr committed May 4, 2021
1 parent b6a5dd6 commit 773d88e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/spectrogram.c
Expand Up @@ -1063,5 +1063,13 @@ main (int argc, char * argv [])

render_sndfile (&render) ;

/* Certain FontConfig objects indirectly referenced via the Cairo
* static data are referenced by integer offsets rather than by
* pointers, so they appear lost to Valgrind unless we call this
* function. Otherwise we would not really care care about freeing
* static data before exiting.
*/
cairo_debug_reset_static_data () ;

return 0 ;
} /* main */

0 comments on commit 773d88e

Please sign in to comment.