From caef340bd8550e1ae5b0735f5d1c65fc74d34208 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Mon, 20 Jan 2014 08:40:27 +0900 Subject: [PATCH] Remove content file only if destroying the common handler For the shared view. If a content file is deleted when a handler of livebox is deleted, The other handler cannot access to the latest content file. So the content file should be deleted when the common handler is deleted. the content file also should be shared with other handlers. Change-Id: I0b70414337f0dab713827a005b1df75d1874aa72 --- packaging/liblivebox-viewer.spec | 2 +- src/livebox.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packaging/liblivebox-viewer.spec b/packaging/liblivebox-viewer.spec index bdff64f..b421cc5 100644 --- a/packaging/liblivebox-viewer.spec +++ b/packaging/liblivebox-viewer.spec @@ -1,6 +1,6 @@ Name: liblivebox-viewer Summary: Library for developing the application -Version: 0.20.4 +Version: 0.20.5 Release: 1 Group: HomeTF/Livebox License: Flora diff --git a/src/livebox.c b/src/livebox.c index 4ebd55a..44c55b4 100644 --- a/src/livebox.c +++ b/src/livebox.c @@ -1313,6 +1313,11 @@ int lb_destroy_common_handle(struct livebox_common *common) dlist_remove_data(s_info.livebox_common_list, common); common->state = DESTROYED; + + if (common->filename) { + (void)util_unlink(common->filename); + } + free(common->cluster); free(common->category); free(common->id); @@ -4419,10 +4424,6 @@ struct livebox *lb_unref(struct livebox *handler, int destroy_common) handler->cbs.key_event.data = NULL; } - if (handler->common->filename) { - (void)util_unlink(handler->common->filename); - } - dlist_remove_data(s_info.livebox_list, handler); handler->state = DESTROYED; -- 2.7.4