mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-25 14:10:10 +01:00
[boilerplate] Restrict number of retries to create an error surface.
Sometimes we just cannot get what we want, so give up - it's only an error surface after all!
This commit is contained in:
parent
77b43da99f
commit
2617d68a7b
1 changed files with 3 additions and 2 deletions
|
|
@ -643,6 +643,7 @@ cairo_surface_t *
|
|||
cairo_boilerplate_surface_create_in_error (cairo_status_t status)
|
||||
{
|
||||
cairo_surface_t *surface = NULL;
|
||||
int loop = 5;
|
||||
|
||||
do {
|
||||
cairo_surface_t *intermediate;
|
||||
|
|
@ -657,9 +658,9 @@ cairo_boilerplate_surface_create_in_error (cairo_status_t status)
|
|||
cairo_append_path (cr, &path);
|
||||
|
||||
cairo_surface_destroy (surface);
|
||||
surface = cairo_get_target (cr);
|
||||
surface = cairo_surface_reference (cairo_get_target (cr));
|
||||
cairo_destroy (cr);
|
||||
} while (cairo_surface_status (surface) != status);
|
||||
} while (cairo_surface_status (surface) != status && --loop);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue