X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-ws.c;h=fb31e4fef69366c3f1abebb715b9554cd5df96ea;hb=51ab7c2f95d6d459302423a57cc617021ef6126d;hp=b2776468af211ac0dd29c5a91e6145dc092797c9;hpb=6dfeafe7e4fa582b3db3f950136bc97f8611fc6d;p=src%2Fapp-framework-binder.git diff --git a/src/afb-ws.c b/src/afb-ws.c index b2776468..fb31e4fe 100644 --- a/src/afb-ws.c +++ b/src/afb-ws.c @@ -120,6 +120,7 @@ static void aws_disconnect(struct afb_ws *ws, int call_on_hangup) struct websock *wsi = ws->ws; if (wsi != NULL) { ws->ws = NULL; + fdev_set_callback(ws->fdev, NULL, 0); fdev_unref(ws->fdev); websock_destroy(wsi); free(ws->buffer.buffer); @@ -133,7 +134,7 @@ static void fdevcb(void *ws, uint32_t revents, struct fdev *fdev) { if ((revents & EPOLLIN) != 0) aws_on_readable(ws); - if ((revents & EPOLLHUP) != 0) + else if ((revents & EPOLLHUP) != 0) afb_ws_hangup(ws); }