mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-07 18:04:46 +00:00
Backed out changeset 854e74094d8c (bug 1293598
) for Windows build bustage and everybody else SVG jemalloc crashes
CLOSED TREE
This commit is contained in:
parent
96fb7b43b9
commit
bcee831dc7
@ -33,31 +33,6 @@
|
||||
|
||||
static const pixman_color_t transparent_black = { 0, 0, 0, 0 };
|
||||
|
||||
/**
|
||||
** bug 1293598 - clean up every pointer after free to avoid
|
||||
** "dereferencing freed memory" problem
|
||||
**/
|
||||
#define PIXMAN_POSION
|
||||
|
||||
static void
|
||||
free_memory_withoffset (void** p, int offset)
|
||||
{
|
||||
#ifdef PIXMAN_POISON
|
||||
if (*p) {
|
||||
#endif
|
||||
free (*p + offset);
|
||||
#ifdef PIXMAN_POISON
|
||||
*p = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
free_memory (void** p)
|
||||
{
|
||||
free_memory_withoffset (p, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
gradient_property_changed (pixman_image_t *image)
|
||||
{
|
||||
@ -170,8 +145,8 @@ _pixman_image_fini (pixman_image_t *image)
|
||||
|
||||
pixman_region32_fini (&common->clip_region);
|
||||
|
||||
free_memory (&common->transform);
|
||||
free_memory (&common->filter_params);
|
||||
free (common->transform);
|
||||
free (common->filter_params);
|
||||
|
||||
if (common->alpha_map)
|
||||
pixman_image_unref ((pixman_image_t *)common->alpha_map);
|
||||
@ -183,7 +158,7 @@ _pixman_image_fini (pixman_image_t *image)
|
||||
if (image->gradient.stops)
|
||||
{
|
||||
/* See _pixman_init_gradient() for an explanation of the - 1 */
|
||||
free_memory_withoffset (&image->gradient.stops, -1);
|
||||
free (image->gradient.stops - 1);
|
||||
}
|
||||
|
||||
/* This will trigger if someone adds a property_changed
|
||||
@ -194,11 +169,8 @@ _pixman_image_fini (pixman_image_t *image)
|
||||
image->common.property_changed == gradient_property_changed);
|
||||
}
|
||||
|
||||
if (image->type == BITS && image->bits.free_me) {
|
||||
free_memory (&image->bits.free_me);
|
||||
image->bits.bits = NULL;
|
||||
}
|
||||
|
||||
if (image->type == BITS && image->bits.free_me)
|
||||
free (image->bits.free_me);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -238,7 +210,7 @@ pixman_image_unref (pixman_image_t *image)
|
||||
{
|
||||
if (_pixman_image_fini (image))
|
||||
{
|
||||
free_memory (&image);
|
||||
free (image);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user