librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

Device does not support AdvancedMode after Dispose

Open amatabuena opened this issue 7 years ago • 3 comments

Required Info
Camera Model D435
Firmware Version 05.10.06
Operating System & Version Windows 10
Kernel Version (Linux Only) ---
Platform PC x86
SDK Version 2.17.0
Language C#
Segment PC

Issue Description

When stopping capture and release Pipeline and Config, if I try to initialize device in order to start capturing again (without reinitializing main program) I receive the error "Device does not support AdvancedMode" when trying to load json configuration again. Other times I receive "Access violation - no RTTI data!".

These errors are causing I can't stop and release camera and play it again.

Thanks.

amatabuena avatar Feb 13 '19 08:02 amatabuena

Could use some more info on reproducing this, but I suspect this is a double Dispose. In which case you can try and add this to the AdvancedDevice:

protected override void Dispose(bool disposing)
{
    // Intentionally empty, does not own the native device, only wraps it.
}

ogoshen avatar Feb 14 '19 08:02 ogoshen

Hi

You are right @ogoshen. Adding this Dispose override to AdvancedDevice solves the issue.

Thanks.

amatabuena avatar Feb 15 '19 12:02 amatabuena

Great, thanks for verifying, it will be handled a PR soon.

ogoshen avatar Feb 17 '19 07:02 ogoshen