Skip to content

Commit

Permalink
wrappers/cpp: Call freenect_process_events_timeout in loop to prevent…
Browse files Browse the repository at this point in the history
… freezes - fixes OpenKinect#223

Signed-off-by: Benn Snyder <[email protected]>
  • Loading branch information
piedar committed Feb 15, 2014
1 parent 5b3f3a7 commit cfe9c49
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wrappers/cpp/libfreenect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ namespace Freenect {
// Do not call directly, thread runs here
void operator()() {
while (!m_stop) {
int res = freenect_process_events(m_ctx);
static timeval timeout = { 1, 0 };
int res = freenect_process_events_timeout(m_ctx, &timeout);
if (res < 0)
{
// libusb signals an error has occurred
Expand Down

0 comments on commit cfe9c49

Please sign in to comment.