[wesnoth-commits] [wesnoth/wesnoth] c40232: font: Fix double resource leak in font::pango_text

Iris Morelle noreply at github.com
Tue Mar 9 04:56:47 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/wesnoth/wesnoth
  Commit: c40232d5049790bc3581602d51e6cf144b1e93d5
      https://github.com/wesnoth/wesnoth/commit/c40232d5049790bc3581602d51e6cf144b1e93d5
  Author: Iris Morelle <shadowm at wesnoth.org>
  Date:   2021-03-09 (Tue, 09 Mar 2021)

  Changed paths:
    M changelog.md
    M src/font/text.cpp

  Log Message:
  -----------
  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().





More information about the Commits mailing list