1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
index 67619b8f..e9ddf9a4 100644
--- a/ivi-shell/ivi-shell.c
+++ b/ivi-shell/ivi-shell.c
@@ -497,44 +497,53 @@ wet_shell_init(struct weston_compositor *compositor,
{
struct ivi_shell *shell;
struct ivi_shell_setting setting = { };
- int retval = -1;
shell = zalloc(sizeof *shell);
if (shell == NULL)
return -1;
if (ivi_shell_setting_create(&setting, compositor, argc, argv) != 0)
- return -1;
+ goto err_shell;
init_ivi_shell(compositor, shell, &setting);
+ /* TODO deinit_ivi_shell should be implemented, since init_ivi_shell is
+ * initializing multiple lists. */
shell->destroy_listener.notify = shell_destroy;
wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener);
if (input_panel_setup(shell) < 0)
- goto out_settings;
+ goto err_settings;
shell->text_backend = text_backend_init(compositor);
if (!shell->text_backend)
- goto out_settings;
+ goto err_settings;
if (wl_global_create(compositor->wl_display,
&ivi_application_interface, 1,
shell, bind_ivi_application) == NULL)
- goto out_settings;
+ goto err_text_backend;
ivi_layout_init_with_compositor(compositor);
+ /* TODO ivi_layout_destroy should be implemented, since multiple lists
+ * and signals are initialized.*/
shell_add_bindings(compositor, shell);
/* Call module_init of ivi-modules which are defined in weston.ini */
if (load_controller_modules(compositor, setting.ivi_module,
argc, argv) < 0)
- goto out_settings;
+ goto err_text_backend;
+
+ return IVI_SUCCEEDED;
- retval = 0;
+err_text_backend:
+ text_backend_destroy(shell->text_backend);
-out_settings:
+err_settings:
free(setting.ivi_module);
- return retval;
+err_shell:
+ free(shell);
+
+ return IVI_FAILED;
}
|