The DLL file is written in C++. Some of the class methods in it have threads enabled and some call Real Sense camera. Then, the interface is written in Python C and invoked by Blender’s Python code.
However, as long as the class method containing thread in DLL is called, blender will crash; When calling the class method with real sense camera API, an error will be reported: realsense error calling RS2_ pipeline_ start_ with_ config()
I wrote a plug-in in blender in Python, wrote an interface through Python C API, used it as a bridge and called DLL. The DLL can be called normally by the plug-in.
but when the method in the DLL uses multithreading, the plug-in calls it, and the blender will crash.
I have tried blender 2.8.3 (Python 3.7) and blender 2.9.3 (Python 3.9), and the results are the same