mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 22:48:07 +02:00
[paginated] Propagate error return during finish.
In bed2701, I removed the explicit finish of the paginated's target
surface, since as a wrapper it did not explicitly own the surface and so
should not be calling finish(). However, we do need to propagate errors
from the backing surface, such as PDF, which will only be detected during
the implicit finish in the final destroy. So check to see it we hold the
last reference to the target (and so our destroy will trigger the implicit
finish) and call the finish explicitly and check the error status
afterwards.
This commit is contained in:
parent
6ca3720ba6
commit
9f6a0f5668
1 changed files with 10 additions and 0 deletions
|
|
@ -159,6 +159,16 @@ _cairo_paginated_surface_finish (void *abstract_surface)
|
|||
status = cairo_surface_status (abstract_surface);
|
||||
}
|
||||
|
||||
/* XXX We want to propagate any errors from destroy(), but those are not
|
||||
* returned via the api. So we need to explicitly finish the target,
|
||||
* and check the status afterwards. However, we can only call finish()
|
||||
* on the target, if we own it.
|
||||
*/
|
||||
if (CAIRO_REFERENCE_COUNT_GET_VALUE (&surface->target->ref_count) == 1) {
|
||||
cairo_surface_finish (surface->target);
|
||||
if (status == CAIRO_STATUS_SUCCESS)
|
||||
status = cairo_surface_status (surface->target);
|
||||
}
|
||||
cairo_surface_destroy (surface->target);
|
||||
|
||||
cairo_surface_finish (surface->meta);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue