X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-evt.c;h=7b7ce4f3ce31b5105055fcbb13a4f718e6c13fbb;hb=9eb56fc592c6e2c305a0fbcc69499271ac034236;hp=88b6d6032dc4e0385ef794c41d9aca1665cca788;hpb=8abd9262e343aec71e07388bdf829d4f76d6529e;p=src%2Fapp-framework-binder.git diff --git a/src/afb-evt.c b/src/afb-evt.c index 88b6d603..7b7ce4f3 100644 --- a/src/afb-evt.c +++ b/src/afb-evt.c @@ -28,6 +28,7 @@ #include #include "afb-evt.h" +#include "verbose.h" struct afb_evt_watch; @@ -173,10 +174,11 @@ static int evt_push(struct afb_evt_event *evt, struct json_object *obj) while(watch) { listener = watch->listener; assert(listener->itf->push != NULL); - if (watch->activity != 0) + if (watch->activity != 0) { listener->itf->push(listener->closure, evt->name, evt->id, json_object_get(obj)); + result++; + } watch = watch->next_by_event; - result++; } pthread_mutex_unlock(&evt->mutex); json_object_put(obj); @@ -480,7 +482,6 @@ int afb_evt_remove_watch(struct afb_evt_listener *listener, struct afb_event eve watch = listener->watchs; while(watch != NULL) { if (watch->event == evt) { - /* found: remove it */ if (watch->activity != 0) { watch->activity--; if (watch->activity == 0 && listener->itf->remove != NULL)