Mercurial > octave
comparison libinterp/corefcn/ft-text-renderer.cc @ 32664:1b65ba91eeda stable
Stop memory leaks in class ft_manager.
Multiple leaks in external library Fontconfig caused by creating resources and
then not calling library routines to destroy them.
* ft-text-renderer.cc (ft_manager::do_get_system_fonts): Call FcPatternDestroy,
FcObjectSetDestroy, FcCharSetDestroy to free memory after use.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 28 Dec 2023 16:00:11 -0800 |
parents | 2e484f9f1f18 |
children | 4536ded2a52b 6f74463268b8 |
comparison
equal
deleted
inserted
replaced
32662:bc244a5f113e | 32664:1b65ba91eeda |
---|---|
258 font_map.assign ("family", families); | 258 font_map.assign ("family", families); |
259 font_map.assign ("angle", angles); | 259 font_map.assign ("angle", angles); |
260 font_map.assign ("weight", weights); | 260 font_map.assign ("weight", weights); |
261 font_map.assign ("suitable", suitable); | 261 font_map.assign ("suitable", suitable); |
262 | 262 |
263 // Free up memory within libfontconfig | |
263 if (fs) | 264 if (fs) |
264 FcFontSetDestroy (fs); | 265 FcFontSetDestroy (fs); |
266 if (pat) // Supposed to be freed by FcFontSetDestroy above, but isn't. | |
267 FcPatternDestroy (pat); | |
268 if (os) | |
269 FcObjectSetDestroy (os); | |
270 if (minimal_charset) | |
271 FcCharSetDestroy (minimal_charset); | |
265 } | 272 } |
266 #endif | 273 #endif |
267 } | 274 } |
268 | 275 |
269 return font_map; | 276 return font_map; |