Hi, I have encountered a potential error while closing many sensors (Orbbec Astra) with the Sensor::close()
function:
[Core.Platform] ***** Encountered fatal exception: Access Violation, PID 5684 *****
0# ImFusion::Platform::getLastWindowsErrorMessage in ImFusionCore
1# ImFusion::Platform::getLastWindowsErrorMessage in ImFusionCore
2# RtlDeleteAce in ntdll
3# RtlRaiseException in ntdll
4# KiUserExceptionDispatcher in ntdll
5# 0x00007FF87AB8CB48 in OpenNI2
6# oniWaitForAnyStream in OpenNI2
7# ImFusion::OpenNI2RGBDStream::captureThread in ImFusionRGBD
8# ImFusion::OpenNI2RGBDStream::IR in ImFusionRGBD
9# ImFusion::FileSensor::~FileSensor in ImFusionRGBD
10# configthreadlocale in ucrtbase
11# BaseThreadInitThunk in KERNEL32
12# RtlUserThreadStart in ntdll
If you read closely the error trace, you can see that thread management is involved RtlUserThreadStart
(hence the error occurs with more than 1 sensor?); furthermore you see that the ~FileSensor
destructor is involved (related to closing the sensor?) and at the same time that some streaming is involved oniWaitForAnyStream
/ImFusion::OpenNI2RGBDStream::captureThread
(maybe internally started with the Sensor::start()
-like code?).
This error happens ONLY when working with >=2
sensors. Furthermore, I have found that calling Sensor::stop()
before Sensor::close()
does not generate this error. However, the main problem is that I am not using the listener-based capturing and not calling the Sensor::start()
function. I have seen this behaviour on two laptop configurations (Windows 10/Windows 10 IoT; Intel i3/i5; with and without external graphic card). Do you consider this behaviour a bug, as the API silently suggests that start()
and stop()
functions should be used only in tandem with the listener-based capturing?