[cairo-pattern] Fix crash in solid-pattern-surface cache

Ickle knew something when he only extended cache size when we are
committed to inserting something into the cache.  I broke that while
fixing other issues a while ago.  This cache just doesn't want to
give us any rest...
This commit is contained in:
Behdad Esfahbod 2008-07-03 19:15:53 -04:00
parent 7c9536b653
commit 1c729f85ed

View file

@ -1478,10 +1478,6 @@ _cairo_pattern_acquire_surface_for_solid (cairo_solid_pattern_t *pattern,
surface = NULL;
}
}
else
{
i = solid_surface_cache.size++;
}
if (surface == NULL) {
/* Not cached, need to create new */
@ -1499,6 +1495,9 @@ _cairo_pattern_acquire_surface_for_solid (cairo_solid_pattern_t *pattern,
}
}
if (i == solid_surface_cache.size)
solid_surface_cache.size++;
to_destroy = solid_surface_cache.cache[i].surface;
solid_surface_cache.cache[i].surface = surface;
solid_surface_cache.cache[i].color = pattern->color;