Commit efae9532 authored by Derek Foreman's avatar Derek Foreman Committed by Pekka Paalanen

server: Disallow sending events to clients after posting an error

Until now, we haven't done anything to prevent sending additional
events to clients after posting an error.
Acked-by: Daniel Stone's avatarDaniel Stone <>
Signed-off-by: default avatarDerek Foreman <>
Reviewed-by: Pekka Paalanen's avatarPekka Paalanen <>
parent 5fbc9daa
......@@ -176,6 +176,9 @@ handle_array(struct wl_resource *resource, uint32_t opcode,
struct wl_closure *closure;
struct wl_object *object = &resource->object;
if (resource->client->error)
closure = wl_closure_marshal(object, opcode, args,
......@@ -249,8 +252,6 @@ wl_resource_post_error(struct wl_resource *resource,
vsnprintf(buffer, sizeof buffer, msg, ap);
client->error = 1;
* When a client aborts, its resources are destroyed in id order,
* which means the display resource is destroyed first. If destruction
......@@ -258,11 +259,12 @@ wl_resource_post_error(struct wl_resource *resource,
* with a NULL display_resource. Do not try to send errors to an
* already dead client.
if (!client->display_resource)
if (client->error || !client->display_resource)
WL_DISPLAY_ERROR, resource, code, buffer);
client->error = 1;
static int
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment