Potential issue

Alexandre Bique <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CAP737oJ93p5z0dR+wLC1Htd_H+S7xy1h-wbBHO8z9+8szNBX+w@mail.gmail.com>
Hi guys,

From this chunk of code (1.14.8)

static cairo_status_t
_cairo_default_context_set_scaled_font (void *abstract_cr,
                                        cairo_scaled_font_t *scaled_font)
{
    cairo_default_context_t *cr = abstract_cr;
    cairo_bool_t was_previous;
    cairo_status_t status;

    if (scaled_font == cr->gstate->scaled_font)
        return CAIRO_STATUS_SUCCESS;

    was_previous = scaled_font == cr->gstate->previous_scaled_font;

    status = _cairo_gstate_set_font_face (cr->gstate, scaled_font->font_face);
    if (unlikely (status))
        return status;

    status = _cairo_gstate_set_font_matrix (cr->gstate,
&scaled_font->font_matrix);
    if (unlikely (status))
        return status;

    _cairo_gstate_set_font_options (cr->gstate, &scaled_font->options);

    if (was_previous)
        cr->gstate->scaled_font = cairo_scaled_font_reference (scaled_font);

    return CAIRO_STATUS_SUCCESS;
}


It seems that if you do cairo_set_scaled_font(cairo_get_scaled_font())
you would trigger a memory leak right?

Regards,
-- 
Alexandre Bique
-- 
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.