Fix the invalid created event handling codes. 24/15324/1
authorSung-jae Park <nicesj.park@samsung.com>
Sun, 19 Jan 2014 12:11:53 +0000 (21:11 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Sun, 19 Jan 2014 12:11:53 +0000 (21:11 +0900)
Change-Id: Id55fafd19a3cb5266225429ce64bba236f31ca60

packaging/liblivebox-viewer.spec
src/client.c

index 7926769..bdff64f 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-viewer
 Summary: Library for developing the application
-Version: 0.20.3
+Version: 0.20.4
 Release: 1
 Group: HomeTF/Livebox
 License: Flora
index 7ae94e1..25d0395 100644 (file)
@@ -1463,14 +1463,10 @@ static struct packet *master_created(pid_t pid, int handle, const struct packet
 
 out:
        if (ret == 0 && old_state == DELETE) {
-               int cnt;
-
-               DbgPrint("Take place unexpected case\n");
-               cnt = common->refcnt;
-               while (cnt > 0) {
-                       l = dlist_nth(common->livebox_list, 0);
-                       handler = dlist_data(l);
+               struct dlist *n;
 
+               DbgPrint("Take place an unexpected case [%d]\n", common->refcnt);
+               dlist_foreach_safe(common->livebox_list, l, n, handler) {
                        if (handler->cbs.created.cb) {
                                if (!handler->common->request.deleted) {
                                        if (lb_send_delete(handler, common->delete_type, handler->cbs.created.cb, handler->cbs.created.data) < 0) {
@@ -1488,8 +1484,6 @@ out:
                                lb_invoke_event_handler(handler, LB_EVENT_DELETED);
                                lb_unref(handler, 1);
                        }
-
-                       cnt--;
                }
 
                /*!