text: font: pango/freetype2: fix correctly freeing font faces
authorDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 11 Aug 2012 12:54:43 +0000 (14:54 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Sat, 11 Aug 2012 12:54:43 +0000 (14:54 +0200)
Whoops, obvious typo. We need to free the face if the refcount drops to
zero and not if it is non-zero.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/text_font_freetype2.c
src/text_font_pango.c

index f21d987..a3c0456 100644 (file)
@@ -519,7 +519,7 @@ static void manager_put_face(struct face *face)
 {
        manager_lock();
 
-       if (--face->ref) {
+       if (!--face->ref) {
                kmscon_dlist_unlink(&face->list);
                kmscon_hashtable_free(face->glyphs);
                pthread_mutex_destroy(&face->glyph_lock);
index 2108487..a77e584 100644 (file)
@@ -343,7 +343,7 @@ static void manager_put_face(struct face *face)
 {
        manager_lock();
 
-       if (--face->ref) {
+       if (!--face->ref) {
                kmscon_dlist_unlink(&face->list);
                kmscon_hashtable_free(face->glyphs);
                pthread_mutex_destroy(&face->glyph_lock);