diff options
author | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp> | 2014-08-04 15:52:13 +0900 |
---|---|---|
committer | Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp> | 2014-08-21 10:08:14 +0900 |
commit | d23c838e1548154be2909e14d5892f8df2720286 (patch) | |
tree | 785ee1118c138b855b5d19a8aaa6a3217785805b | |
parent | 8d293475af7d7bc9486c15c7360f729d7e766d15 (diff) | |
download | wayland-ivi-extension-d23c838e1548154be2909e14d5892f8df2720286.tar.gz |
weston-ivi-shell: fix a memory leak of surface and resource.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@denso.co.jp>
-rwxr-xr-x | weston-ivi-shell/src/ivi-controller.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c index 434fc4b..d781f2d 100755 --- a/weston-ivi-shell/src/ivi-controller.c +++ b/weston-ivi-shell/src/ivi-controller.c @@ -1280,6 +1280,11 @@ controller_surface_create(struct wl_client *client, struct ivisurface *ivisurf = NULL; struct ivicontroller_surface *ctrl_link = NULL; + ivisurf = get_surface(&shell->list_surface, id_surface); + if (ivisurf == NULL) { + return; + } + ctrlsurf = calloc(1, sizeof *ctrlsurf); if (!ctrlsurf) { weston_log("no memory to allocate controller surface\n"); @@ -1300,11 +1305,6 @@ controller_surface_create(struct wl_client *client, return; } - ivisurf = get_surface(&shell->list_surface, id_surface); - if (ivisurf == NULL) { - return; - } - wl_list_for_each(ctrl_link, &shell->list_controller_surface, link) { if ((ctrl_link->implementation_set == 0) && (ctrl_link->id_surface == id_surface) && |