struct wl_closure *closure;
struct wl_object *object = &resource->object;
+ if (resource->client->error)
+ return;
+
closure = wl_closure_marshal(object, opcode, args,
&object->interface->events[opcode]);
vsnprintf(buffer, sizeof buffer, msg, ap);
va_end(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
* 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)
return;
wl_resource_post_event(client->display_resource,
WL_DISPLAY_ERROR, resource, code, buffer);
+ client->error = 1;
}
static int