[PATCH weston] ivi-shell-transition: check create_layout_transition() return value.
Daniel Stone
daniel at fooishbar.org
Tue Jan 27 06:44:54 PST 2015
Tanibata-san,
On 19 January 2015 at 02:04, Tanibata, Nobuhiko (ADITJ/SWG)
<ntanibata at jp.adit-jv.com> wrote:
> I basically agree this solution.
> When I observe other code in Weston. There are two patterns when error happens in Weston.
> - just output error by Weston_log. And then return from the method.
> - use wl_resource_post_error and then disconnect client.
> Does somebody know which one is better for memory allocate error?
It really depends on the use. If something is optional and does not
result in any client-visible impact, then logging and returning an
error is acceptable. This is particularly true in the case where we
are not in a request handler, e.g.:
- client creates request to do some work
- compositor decides to do this work in future, so creates 'delayed work' item
- [some time later] compositor tries to do work, fails to allocate
In this situation, by step #3 we cannot return an error to the client.
However, in almost all request handlers, we should be calling
wl_resource_post_no_memory() if the error is OOM, or
wl_resource_post_error if there is some other/specific error.
Cheers,
Daniel
More information about the wayland-devel
mailing list