Skip to content

Commit cfe9c49

Browse files
committed
wrappers/cpp: Call freenect_process_events_timeout in loop to prevent freezes - fixes #223
Signed-off-by: Benn Snyder <[email protected]>
1 parent 5b3f3a7 commit cfe9c49

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

wrappers/cpp/libfreenect.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ namespace Freenect {
218218
// Do not call directly, thread runs here
219219
void operator()() {
220220
while (!m_stop) {
221-
int res = freenect_process_events(m_ctx);
221+
static timeval timeout = { 1, 0 };
222+
int res = freenect_process_events_timeout(m_ctx, &timeout);
222223
if (res < 0)
223224
{
224225
// libusb signals an error has occurred

0 commit comments

Comments
 (0)