microsoft / Azure-Kinect-Sensor-SDK

A cross platform (Linux and Windows) user mode SDK to read data from your Azure Kinect device.
https://Azure.com/Kinect
MIT License
1.5k stars 620 forks source link

Crash on exit when the SDK is not used, only linked #1502

Open fran6co opened 3 years ago

fran6co commented 3 years ago

Describe the bug

A simple app that only links to the SDK but doesn't call any function crashes on exit.

To Reproduce

Create a simple app

int main() {
   return 0;
}

That is linked to the SDK

Expected behavior

Not crash

Logs

image

Desktop (please complete the following information):

fran6co commented 3 years ago

This is because https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/src/deloader/deloader.cpp#L258 calls deloader_global_context_t_get() that will initialize the plugin for the first time for then to tear it down. A fix would be adding a way to check if the singleton had been created before destroying it