Livox-SDK / Livox-SDK2

Drivers for receiving LiDAR data and controlling lidar, support Lidar HAP and Mid-360.
Other
89 stars 57 forks source link

Fix detection thread not starting at second SdkInit #38

Closed belugum closed 12 months ago

belugum commented 1 year ago

When uninitializing and initializing again, the device detection thread doesn't start properly (depends on the platform, undefined behaviour). This fixes the issue. The bug is reproducible by looping the livox_lidar_quick_start sample: without my fix it only works the first iteration (on Windows, but works on Linux...), with my fix it works properly.

belugum commented 1 year ago

I added another commit which fixes a crash when trying another SdkInit after error on previous attempt followed by UnInit. The destructors were not called on UnInit because the Init was not successful, but some ressources did need to be destroyed to allow a subsequent successful initialization.