Re: cairo_font_face_t not freeing

Louis M <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On Tue, 2 May 2017 14:55:20 +1200, Lawrence D'Oliveiro wrote:

>     You are looking at garbage pointed to by an invalid pointer.

Hi Lawrence and thank you for your answer,

I am sorry. Maybe I was not clear enough in my previous email. I removed some lines of code to keep my example minimal. I know that the pointer seems like an invalid pointer in my example, but it is not. We can see that by replacing those two lines:

    cairo_font_face_destroy(font_face);
    printf("Refcount=%d\n", cairo_font_face_get_reference_count(font_face));

By those three lines:

    printf("Refcount before freeing=%d\n", cairo_font_face_get_reference_count(font_face));
    cairo_font_face_destroy(font_face);
    printf("Refcount after freeing=%d\n", cairo_font_face_get_reference_count(font_face));

The pointer before the 'cairo_font_face_destroy' should be valid because I didn't free the it yet. The output of this example program is this:

Refcount before freeing=2
Refcount after freeing=1

Thanks,

Louis

 


-- 
cairo mailing list
[email protected]
https://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.