Summary: | cairo_*_destroy() lack status return | ||
---|---|---|---|
Product: | cairo | Reporter: | Steve Chaplin <d74n5pohf9> |
Component: | general | Assignee: | Carl Worth <cworth> |
Status: | RESOLVED MOVED | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | normal | ||
Priority: | high | CC: | tiwari.shekhar13 |
Version: | 1.1.7 | ||
Hardware: | x86 (IA32) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
demonstrate that error status is not reported
Updated test case with explicit cairo_surface_finish() |
Description
Steve Chaplin
2006-05-27 15:28:50 UTC
Created attachment 5747 [details]
demonstrate that error status is not reported
The problem with the test case is that the surfaces do not attempt to write to the stream until cairo_surface_finish() (in this case called implicitly from cairo_surface_destroy) at which point the error status has been silently lost. After adding cairo_surface_finish() before the cairo_surface_status(), the test output becomes: status (CAIRO_STATUS_SUCCESS is 0) PNG 11 (error while writing to output stream) PS 0 (success), 11 (error while writing to output stream) PDF 0 (success), 11 (error while writing to output stream) SVG 0 (success), 11 (error while writing to output stream) Created attachment 11755 [details]
Updated test case with explicit cairo_surface_finish()
Stephen, I've added test cases to ensure that a write error is propagated back to the application - but given the API constraints the application must call cairo_surface_finish() explicitly to ensure that the surface is written out (which requires fiddling with cairo_surface_get_refererence_count() in its surface_destroy function for PyCairo to support throwing exceptions from write-out). Retitling to reflect issue with current cairo_*_destroy() API. We've discussed changing _destroy() functions to return cairo_status before. Not sure how nicely that maps to language bindings though. -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/285. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.