Remove content file only if destroying the common handler 25/15325/1
authorSung-jae Park <nicesj.park@samsung.com>
Sun, 19 Jan 2014 23:40:27 +0000 (08:40 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Sun, 19 Jan 2014 23:40:27 +0000 (08:40 +0900)
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
src/livebox.c

index bdff64f..b421cc5 100644 (file)
@@ -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
index 4ebd55a..44c55b4 100644 (file)
@@ -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;