Solved:Shut down all threads if "Unload" DLL ? c++

I`m using external logger for other framework that works with touch.

AttachToLogger();

If in touchdesigner I will click unload dll
the logger will still run.
there is some general way to control it and kill the logger ?

or

I should do parameter in the cpp file to control it ?
(i can do script with some delay etc )

Update :
this might be usefull :

[code] DestroySOPInstance(SOP_CPlusPlusBase* instance)
{
// Delete the instance here, this will be called when
// Touch is shutting down, when the SOP using that instance is deleted, or
// if the SOP loads a different DLL
delete (MVX2TouchDesigner*)instance;

}[/code]