[PATCH weston v4 14/14] compositor-wayland: move weston_wayland_backend_config_release call from load_wayland_backend_config to caller

Benoit Gschwind gschwind at gnu-log.net
Tue May 10 20:47:57 UTC 2016


Signed-off-by: Benoit Gschwind <gschwind at gnu-log.net>
---
 src/main.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/main.c b/src/main.c
index d0a962f..06baae3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1170,7 +1170,7 @@ load_wayland_backend_config(struct weston_compositor *compositor, int *argc,
 	if (config->fullscreen) {
 		oc = weston_wayland_backend_config_add_new_output(config);
 		if (!oc)
-			goto err_outputs;
+			return -1;
 
 		oc->width = width;
 		oc->height = height;
@@ -1198,7 +1198,7 @@ load_wayland_backend_config(struct weston_compositor *compositor, int *argc,
 		oc = weston_wayland_backend_config_add_new_output(config);
 
 		if (!oc)
-			goto err_outputs;
+			return -1;
 
 		weston_wayland_output_config_init(oc, section, width,
 						  height, scale);
@@ -1216,7 +1216,7 @@ load_wayland_backend_config(struct weston_compositor *compositor, int *argc,
 		oc = weston_wayland_backend_config_add_new_output(config);
 
 		if (!oc)
-			goto err_outputs;
+			return -1;
 
 		oc->width = width;
 		oc->height = height;
@@ -1228,10 +1228,6 @@ load_wayland_backend_config(struct weston_compositor *compositor, int *argc,
 	}
 
 	return 0;
-
-err_outputs:
-	weston_wayland_backend_config_release(config);
-	return -1;
 }
 
 static int
@@ -1243,6 +1239,7 @@ load_wayland_backend(struct weston_compositor *c, char const * backend,
 
 	ret = load_wayland_backend_config(c, argc, argv, wc, &config);
 	if(ret < 0) {
+		weston_wayland_backend_config_release(&config);
 		return ret;
 	}
 
-- 
2.7.3



More information about the wayland-devel mailing list