[cairo] Atomic reference counting

Chris Wilson chris at chris-wilson.co.uk
Fri Sep 21 15:13:11 PDT 2007


Chris Wilson (chris at chris-wilson.co.uk) said: 
> The second patch converts the reference counting within cairo over to
> the new primitives.

Which of course contains a badly merged chunk...

> @@ -715,38 +712,35 @@ cairo_scaled_font_destroy (cairo_scaled_font_t *scaled_font)
>      cairo_scaled_font_map_t *font_map;
>      cairo_scaled_font_t *lru = NULL;
>  
> -    if (scaled_font == NULL || scaled_font->ref_count == CAIRO_REF_COUNT_INVALID)
> +    if (scaled_font == NULL ||
> +	    scaled_font->ref_count == CAIRO_REF_COUNT_INVALID)
>  	return;
>  
> +    assert (font_map != NULL);
> +    assert (scaled_font->ref_count > 0);
> +
>      font_map = _cairo_scaled_font_map_lock ();

Asserting before we even try to acquire the lock. Grrr. The rest however
appears mostly harmless.
--
Chris Wilson


More information about the cairo mailing list