Hi,
Im using the SDK code, I had few hardware problem that cause the camera to disconnect and reconnect again, in this case the sensor manager recognize 2 sensors and when i want to use it one of the sensor had disconnect. in this case i want to recover and set the sensor manager again.
Im trying to re-create the sensor manager class in recover function i want to activate:
void Recover()
{
delete m_sensorManager;
m_sensorManager = new SensorManager();
int numSensors = m_sensorManager->deviceCount();
for (int i = 0; i < numSensors; i++) {
m_sensor[i] = m_sensorManager->sensor(i);
bool ok = m_sensor[i]->open(params.cw, params.ch, params.dw, params.dh);
if (!ok) {
// Error
}
else {
// open sensor
}
}
}
for the line: “delete m_sensorManager;” i got an exception:
[Core.Platform] ***** Encountered fatal exception: Access Violation, PID 40224 ***
0# ImFusion::Platform::getLastWindowsErrorMessage in ImFusionCore
1# ImFusion::Platform::getLastWindowsErrorMessage in ImFusionCore
2# RtlIsGenericTableEmpty in ntdll
3# RtlRaiseException in ntdll
4# KiUserExceptionDispatcher in ntdll
5# RecFusion::Sensor::isOpen in RecFusionSDK
6# ImFusion::Stream::updateListenersData in ImFusionStream
7# ImFusion::RealSenseStream::captureThread in ImFusionRGBD
8# ImFusion::RealSenseStream::~RealSenseStream in ImFusionRGBD
9# ImFusion::FileSensor::~FileSensor in ImFusionRGBD
10# beginthreadex in ucrtbase
11# BaseThreadInitThunk in KERNEL32
12# RtlUserThreadStart in ntdll
any advice ?
Thanks