Where is a right place in Extension Manager to release resources

Hi,

I am developing a plugin for LN 8.0.2. Inside of my Extension Manager I use my own COM object.

In performance considerations I want to do initialization and resource releasing only once.

If I call <my_com_ptr>.Release() at DLL_PROCESS_DETACH I always get a LN crash.

So the question is: when do I have to release my COM? Is there any event for this?