Re: How to use Pango::Context?

Kjell Ahlstedt via gtkmm-list <[email protected]> Mon, 21 Feb 2022 19:21:42 +0100
Newsgroups gmane.comp.gnome.gtkmm
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============2492136330918759295==
Content-Type: multipart/alternative;
 boundary="------------RrTD6W01POxaJv6bLQjM3m0K"
Content-Language: en-US

This is a multi-part message in MIME format.
--------------RrTD6W01POxaJv6bLQjM3m0K
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

It's a bug in Pango::Context::get_font_map(). It should get its own 
reference to the font map, but it doesn't. Until the bug has been fixed 
in pangomm, you can add a reference yourself.

auto fontMap = context->get_font_map();
fontMap->reference();  // Temporary bug fix

Note that when you start using a fixed version of pangomm, the call to 
fontMap->reference() will cause a memory leak.

Den 2022-02-21 kl. 16:12, skrev phosit--- via gtkmm-list:
>> does the error occur if you do windows.reserve(2) before the
>> emplace_back()s?
> Yes
> _______________________________________________
--------------RrTD6W01POxaJv6bLQjM3m0K
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><font size="2">It's a bug in Pango::Context::get_font_map(). It
        should get its own reference to the font map, but it doesn't.
        Until the bug has been fixed in pangomm, you can add a reference
        yourself.</font></p>
    <p><font size="2">auto fontMap = context-&gt;get_font_map(); <br>
        fontMap-&gt;reference();  // Temporary bug fix</font></p>
    <p><font size="2">Note that when you start using a fixed version of
        pangomm, the call to fontMap-&gt;reference() will cause a memory
        leak.<br>
      </font></p>
    <div class="moz-cite-prefix"><font size="2">Den 2022-02-21 kl.
        16:12, skrev phosit--- via gtkmm-list:<br>
      </font></div>
    <blockquote type="cite"
      cite="mid:20220221161237.2c2c64c6@phositlinuxtop">
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">does the error occur if you do windows.reserve(2) before the
emplace_back()s?
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
Yes
_______________________________________________
</pre>
    </blockquote>
  </body>
</html>

--------------RrTD6W01POxaJv6bLQjM3m0K--

--===============2492136330918759295==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gtkmm-list mailing list
[email protected]
https://mail.gnome.org/mailman/listinfo/gtkmm-list

--===============2492136330918759295==--