recording: Cleanup the clip on error.

Whilst recording the commands, remember to cleanup the local clip after
detecting an error.
This commit is contained in:
Chris Wilson 2010-03-22 13:05:23 +00:00
parent c87737c2bf
commit 48d8471625
2 changed files with 7 additions and 0 deletions

View file

@ -347,6 +347,7 @@ _cairo_recording_surface_paint (void *abstract_surface,
CLEANUP_SOURCE:
_cairo_pattern_fini_snapshot (&command->source.base);
CLEANUP_COMMAND:
_cairo_clip_fini (&command->header.clip);
free (command);
return status;
}
@ -390,6 +391,7 @@ _cairo_recording_surface_mask (void *abstract_surface,
CLEANUP_SOURCE:
_cairo_pattern_fini_snapshot (&command->source.base);
CLEANUP_COMMAND:
_cairo_clip_fini (&command->header.clip);
free (command);
return status;
}
@ -449,6 +451,7 @@ _cairo_recording_surface_stroke (void *abstract_surface,
CLEANUP_SOURCE:
_cairo_pattern_fini_snapshot (&command->source.base);
CLEANUP_COMMAND:
_cairo_clip_fini (&command->header.clip);
free (command);
return status;
}
@ -499,6 +502,7 @@ _cairo_recording_surface_fill (void *abstract_surface,
CLEANUP_SOURCE:
_cairo_pattern_fini_snapshot (&command->source.base);
CLEANUP_COMMAND:
_cairo_clip_fini (&command->header.clip);
free (command);
return status;
}
@ -592,6 +596,7 @@ _cairo_recording_surface_show_text_glyphs (void *abstract_surface,
_cairo_pattern_fini_snapshot (&command->source.base);
CLEANUP_COMMAND:
_cairo_clip_fini (&command->header.clip);
free (command);
return status;
}

View file

@ -119,6 +119,7 @@ _cairo_surface_snapshot_copy_on_write (cairo_surface_t *surface)
status = _cairo_surface_acquire_source_image (snapshot->target, &image, &extra);
if (unlikely (status)) {
snapshot->target = _cairo_surface_create_in_error (status);
status = _cairo_surface_set_error (surface, status);
return;
}
@ -140,6 +141,7 @@ _cairo_surface_snapshot_copy_on_write (cairo_surface_t *surface)
snapshot->clone = &clone->base;
} else {
snapshot->clone = &clone->base;
status = _cairo_surface_set_error (surface, clone->base.status);
}
_cairo_surface_release_source_image (snapshot->target, image, extra);