X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-evt.c;h=7b7ce4f3ce31b5105055fcbb13a4f718e6c13fbb;hb=6f1126ae2c585afc34d0bb06f3763e3a82ee3d37;hp=2abbc819f716f1683448b5ad9bd059528901fe7c;hpb=ca9807f73646f536ac58c002d963a8bb8d245f5d;p=src%2Fapp-framework-binder.git diff --git a/src/afb-evt.c b/src/afb-evt.c index 2abbc819..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); @@ -234,6 +236,7 @@ static void evt_destroy(struct afb_evt_event *evt) if (evt != NULL) { /* unlinks the event if valid! */ pthread_mutex_lock(&events_mutex); + found = 0; prv = &events; while (*prv && !(found = (*prv == evt))) prv = &(*prv)->next; @@ -479,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)