mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-06-04 22:38:19 +02:00
[core] put back REF_COUNT_INVALID to be -1, fix finish
Previous commit broke cairo_surface_finish, since it was checking for ref_count == CAIRO_REF_COUNT_INVALID and bailing. But, that condition was reached from destroy, so finish was bailing out early.
This commit is contained in:
parent
cf73118522
commit
5a72aac598
6 changed files with 16 additions and 1 deletions
|
|
@ -178,6 +178,9 @@ cairo_font_face_get_type (cairo_font_face_t *font_face)
|
|||
unsigned int
|
||||
cairo_font_face_get_reference_count (cairo_font_face_t *font_face)
|
||||
{
|
||||
if (font_face->ref_count == CAIRO_REF_COUNT_INVALID)
|
||||
return 0;
|
||||
|
||||
return font_face->ref_count;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -592,6 +592,9 @@ slim_hidden_def (cairo_pattern_destroy);
|
|||
unsigned int
|
||||
cairo_pattern_get_reference_count (cairo_pattern_t *pattern)
|
||||
{
|
||||
if (pattern->ref_count == CAIRO_REF_COUNT_INVALID)
|
||||
return 0;
|
||||
|
||||
return pattern->ref_count;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -638,6 +638,9 @@ slim_hidden_def (cairo_scaled_font_destroy);
|
|||
unsigned int
|
||||
cairo_scaled_font_get_reference_count (cairo_scaled_font_t *scaled_font)
|
||||
{
|
||||
if (scaled_font->ref_count == CAIRO_REF_COUNT_INVALID)
|
||||
return 0;
|
||||
|
||||
return scaled_font->ref_count;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -405,6 +405,9 @@ slim_hidden_def(cairo_surface_destroy);
|
|||
unsigned int
|
||||
cairo_surface_get_reference_count (cairo_surface_t *surface)
|
||||
{
|
||||
if (surface->ref_count == CAIRO_REF_COUNT_INVALID)
|
||||
return 0;
|
||||
|
||||
return surface->ref_count;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -345,6 +345,9 @@ cairo_set_user_data (cairo_t *cr,
|
|||
unsigned int
|
||||
cairo_get_reference_count (cairo_t *cr)
|
||||
{
|
||||
if (cr->ref_count == CAIRO_REF_COUNT_INVALID)
|
||||
return 0;
|
||||
|
||||
return cr->ref_count;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ do { \
|
|||
assert (NOT_REACHED); \
|
||||
} while (0)
|
||||
|
||||
#define CAIRO_REF_COUNT_INVALID (0)
|
||||
#define CAIRO_REF_COUNT_INVALID ((unsigned int) -1)
|
||||
|
||||
#include "cairo-wideint-private.h"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue