font: Fix double resource leak in font::pango_text
The impacted code path is only executed as part of the implementation of the characters_per_line constraint. According to the Pango documentation, PangoFontMetrics should be released using pango_font_metrics_unref(), and PangoFont should be released using *something* not specified. Existing code, and the documentation for pango_fontset_get_font(), suggests the answer for the latter is g_object_unref().
This commit is contained in:
parent
7ed2a7abf6
commit
c40232d504
2 changed files with 4 additions and 0 deletions
|
@ -21,6 +21,7 @@
|
|||
### User interface
|
||||
* Improved the Load dialog when there are no saved games for the current version, and also when there are corrupted files.
|
||||
* Re-added the pop-up when there are no saved games at all (issue #5517).
|
||||
* Fixed resource leak in the Pango text rendering pipeline when using the characters_per_line constraint.
|
||||
### WML Engine
|
||||
* Standard Location Filters now support gives_income=yes|no to make it simpler to match villages regardless of owner
|
||||
### Miscellaneous and Bug Fixes
|
||||
|
|
|
@ -518,6 +518,9 @@ PangoRectangle pango_text::calculate_size(PangoLayout& layout) const
|
|||
w *= characters_per_line_;
|
||||
|
||||
maximum_width = ceil(pango_units_to_double(w));
|
||||
|
||||
pango_font_metrics_unref(m);
|
||||
g_object_unref(f);
|
||||
} else {
|
||||
maximum_width = maximum_width_;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue