]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commit
Fix pango fontmap threading issue. 601/head
authorJoakim Soderberg <joakim.soderberg@gmail.com>
Wed, 1 Apr 2015 13:28:58 +0000 (15:28 +0200)
committerJoakim Soderberg <joakim.soderberg@gmail.com>
Wed, 1 Apr 2015 13:28:58 +0000 (15:28 +0200)
commite1f6ee13380e1eeeaae66506348ce39a5ff33572
tree63f4a0a77de4b73aac56733e0f39c1955a8328e9
parent120bfb0c3b5ecfdd647d636201eeb071e37da8bf
Fix pango fontmap threading issue.

Since pango v1.32.6 `pango_cairo_font_map_get_default` returns a per thread `fontmap`. But since we're allocating this statically on the first call to `rrd_init`,
if we then try to access it again via another thread glib will get stuck in an infinte assertion loop.

Instead use `pango_cairo_font_map_new()` when creating the `fontmap`. This will not create a per thread version and glib will be happy.

Also added some extra locking whenever using the `im->layout` pango structure that uses the `fontmap` internally as a precaution.
src/rrd_graph.c
src/rrd_graph.h