libfreenect/libfreenect-0.5.3-noabort.patch

19 lines
669 B
Diff
Raw Normal View History

diff -up ./wrappers/cpp/cppview.cpp.noabort ./wrappers/cpp/cppview.cpp
--- ./wrappers/cpp/cppview.cpp.noabort 2016-02-21 11:03:00.653334752 -0500
+++ ./wrappers/cpp/cppview.cpp 2016-02-21 11:04:51.022655752 -0500
@@ -348,7 +348,13 @@ void *gl_threadfunc(void *arg)
}
int main(int argc, char **argv) {
- device = &freenect.createDevice<MyFreenectDevice>(0);
+ try {
+ device = &freenect.createDevice<MyFreenectDevice>(0);
+ }
+ catch (std::exception &e) {
+ std::cerr << std::endl << "Exception starting Freenect device : " << e.what() << std::endl;
+ exit(1);
+ }
device->startVideo();
device->startDepth();
gl_threadfunc(NULL);