diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2014-08-07 16:43:12 -0400 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2014-08-08 14:57:17 -0700 |
commit | c91408f3fb7e9a98e787e9f7e370b0298083431b (patch) | |
tree | 3751f5bc1fc74f67c89632ee335442e817b3f62e | |
parent | 0013a29d5e8e9d25e8b3c5c6d672489ae4d7e943 (diff) | |
download | weston-c91408f3fb7e9a98e787e9f7e370b0298083431b.tar.gz |
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.
-rw-r--r-- | desktop-shell/input-panel.c | 1 | ||||
-rw-r--r-- | desktop-shell/shell.c | 2 | ||||
-rw-r--r-- | src/screenshooter.c | 1 | ||||
-rw-r--r-- | src/text-backend.c | 2 |
4 files changed, 0 insertions, 6 deletions
diff --git a/desktop-shell/input-panel.c b/desktop-shell/input-panel.c index 47bd73c1..435cd5d6 100644 --- a/desktop-shell/input-panel.c +++ b/desktop-shell/input-panel.c @@ -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 diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 5a613f1e..250cf884 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -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 { diff --git a/src/screenshooter.c b/src/screenshooter.c index 369e9204..9ae0d29c 100644 --- a/src/screenshooter.c +++ b/src/screenshooter.c @@ -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, diff --git a/src/text-backend.c b/src/text-backend.c index d6a6f3b3..1d549d43 100644 --- a/src/text-backend.c +++ b/src/text-backend.c @@ -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; } |