summaryrefslogtreecommitdiff
path: root/libusb/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'libusb/io.c')
-rw-r--r--libusb/io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libusb/io.c b/libusb/io.c
index 4c29046..1e9357c 100644
--- a/libusb/io.c
+++ b/libusb/io.c
@@ -2149,6 +2149,7 @@ static int handle_events(struct libusb_context *ctx, struct timeval *tv)
}
fds = ctx->pollfds;
nfds = ctx->pollfds_cnt;
+ usbi_inc_fds_ref(fds, nfds);
usbi_mutex_unlock(&ctx->event_data_lock);
timeout_ms = (int)(tv->tv_sec * 1000) + (tv->tv_usec / 1000);
@@ -2281,6 +2282,7 @@ static int handle_events(struct libusb_context *ctx, struct timeval *tv)
done:
usbi_end_event_handling(ctx);
+ usbi_dec_fds_ref(fds, nfds);
return r;
}