Don't bother destroying resources after sending an error

An error makes the client exit, which cleans up the resources anyway.

Note (Jason Ekstrand):
This is safe for two reasons.  First, we should be handling object
destruction nicely anyway.  Second, in each of these cases, the resources
don't have any implementation or destruction set so it has absolutely no
effect on the rest of weston whether we destroy it now or later.
This commit is contained in:
Jasper St. Pierre 2014-08-07 16:43:12 -04:00 committed by Jason Ekstrand
parent 0013a29d5e
commit c91408f3fb
4 changed files with 0 additions and 6 deletions

View File

@ -356,7 +356,6 @@ bind_input_panel(struct wl_client *client,
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
"interface object already bound");
wl_resource_destroy(resource);
}
void

View File

@ -5347,7 +5347,6 @@ bind_desktop_shell(struct wl_client *client,
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
"permission to bind desktop_shell denied");
wl_resource_destroy(resource);
}
static void
@ -5431,7 +5430,6 @@ bind_screensaver(struct wl_client *client,
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
"interface object already bound");
wl_resource_destroy(resource);
}
struct switcher {

View File

@ -265,7 +265,6 @@ bind_shooter(struct wl_client *client,
if (client != shooter->client) {
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
"screenshooter failed: permission denied");
wl_resource_destroy(resource);
}
wl_resource_set_implementation(resource, &screenshooter_implementation,

View File

@ -790,14 +790,12 @@ bind_input_method(struct wl_client *client,
if (input_method->input_method_binding != NULL) {
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
"interface object already bound");
wl_resource_destroy(resource);
return;
}
if (text_backend->input_method.client != client) {
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
"permission to bind input_method denied");
wl_resource_destroy(resource);
return;
}