问题
For example if you have a simple managed console app and a simple unmanaged C++ DLL. You pInvoke into a function in the C++ DLL, does the DLL stay loaded in the unmanaged process until said process comes down? Or does the DLL get unloaded at the completion of every pInvoke call?
回答1:
It stays in memory unless you explicity tell it to unload.
来源:https://stackoverflow.com/questions/3920261/whats-the-lifetime-of-an-unmanaged-dll-once-its-been-pinovked-from-managed-cod