From: Sung-jae Park Date: Sun, 19 Jan 2014 23:40:27 +0000 (+0900) Subject: Remove content file only if destroying the common handler X-Git-Tag: accepted/tizen/generic/20140226.073644~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=caef340bd8550e1ae5b0735f5d1c65fc74d34208;p=platform%2Fframework%2Fweb%2Flivebox-viewer.git 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 --- 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;