You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue happens randomly on my machine: By running the sample code available on the docs, sometimes the program would freeze for several seconds just before the exit point. After digging into the code, I found out that the library was freezing at the "freenect_process_events(m_ctx)" call. By moving the "m_stop=true" assignment to the top of the Freenect destructor, the device thread would finish without any problems while the m_devices container is being erased.
So, to solve this, I just had to apply these changes:
--- a/wrappers/cpp/libfreenect.hpp
+++ b/wrappers/cpp/libfreenect.hpp
@@ -182,10 +182,10 @@ namespaceFreenect {
if(pthread_create(&m_thread, NULL, pthread_callback, (void*)this) != 0) throwstd::runtime_error("Cannot initialize freenect thread");
}
~Freenect() {
+ m_stop = true;
for(DeviceMap::iterator it = m_devices.begin() ; it != m_devices.end() ; ++it) {
delete it->second;
}
- m_stop = true;
pthread_join(m_thread, NULL);
if(freenect_shutdown(m_ctx) < 0){} //FN_WARNING("Freenect did not shutdown in a clean fashion");
}
The text was updated successfully, but these errors were encountered:
libfreenect v0.3.0 Nucleus
* tag 'v0.3.0':
Update CMakeLists.txt for v0.3.0
OpenNI2-FreenectDriver: update README.md
OpenNI2-FreenectDriver: OFF by default; pass -DBUILD_OPENNI2_DRIVER=ON to cmake to enable
OpenNI2-FreenectDriver: support ONI_STREAM_PROPERTY_AUTO_WHITE_BALANCE and ONI_STREAM_PROPERTY_AUTO_EXPOSURE
OpenNI2-FreenectDriver: reduce compiler warnings
Added chunk processing callbacks for depth and video streams - fixesOpenKinect#351
Fix missing semicolon in fakenect/record.c
wrappers/cpp: Remove pureness from virtual callbacks - fixesOpenKinect#286
Update CMakeLists.txt for v0.2.1
wrappers/cpp: replace std::make_pair with and more compatible assignment - fixesOpenKinect#339
wrappers/cpp: Stop loop before clearing devices (prevents hang on exit) - fixesOpenKinect#295
OpenNI2-FreenectDriver: initial commit
fakenect: Fix memory leaks - fixesOpenKinect#205
csharp: Update Enumerations.cs - fixesOpenKinect#285
Tweaks to freenect_flag commit
Fix include of libusb.h in wrappers/cpp/libfreenect.hpp
Make freenect_flags an actual flag enum
Added Gentoo Linux ebuilds
Added error reporting for failed subdevice initialization.
Added a feature to use accelerometer data to rotate camera view in software when the camera is physically rotated such that the view on the screen is always upright even when the camera is upside down. Enabling it, and disabling it is done with the "r" key. Not on by default. I enabled several things that were disabled in the last patch, but only when rotation mode is toggled on.
This issue happens randomly on my machine: By running the sample code available on the docs, sometimes the program would freeze for several seconds just before the exit point. After digging into the code, I found out that the library was freezing at the "freenect_process_events(m_ctx)" call. By moving the "m_stop=true" assignment to the top of the Freenect destructor, the device thread would finish without any problems while the m_devices container is being erased.
So, to solve this, I just had to apply these changes:
The text was updated successfully, but these errors were encountered: