[PATCH][weston 1/2] ivi-layout-transition: Change layout_transition_register return type

Lucas Tanure tanure at linux.com
Mon Sep 21 10:10:32 PDT 2015


layout_transition_register could not work and we need to free trans in
the calling function.

Signed-off-by: Lucas Tanure <tanure at linux.com>
---
 ivi-shell/ivi-layout-transition.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/ivi-shell/ivi-layout-transition.c b/ivi-shell/ivi-layout-transition.c
index 6370e8f..8d477b4 100644
--- a/ivi-shell/ivi-layout-transition.c
+++ b/ivi-shell/ivi-layout-transition.c
@@ -27,6 +27,7 @@
 #include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <stdbool.h>
 
 #include "ivi-layout-export.h"
 #include "ivi-layout-private.h"
@@ -181,7 +182,7 @@ ivi_layout_transition_set_create(struct weston_compositor *ec)
 	return transitions;
 }
 
-static void
+static bool
 layout_transition_register(struct ivi_layout_transition *trans)
 {
 	struct ivi_layout *layout = get_instance();
@@ -190,11 +191,12 @@ layout_transition_register(struct ivi_layout_transition *trans)
 	node = malloc(sizeof(*node));
 	if (node == NULL) {
 		weston_log("%s: memory allocation fails\n", __func__);
-		return;
+		return false;
 	}
 
 	node->transition = trans;
 	wl_list_insert(&layout->pending_transition_list, &node->link);
+	return true;
 }
 
 static void
-- 
2.5.3



More information about the wayland-devel mailing list