I'm using C# in Unity and I'm using the code here to free a C++ compiled dll (native plugin in Unity) that is loaded via code like this:
[DllImport ("ASimplePlugin")]
private static extern int PrintANumber();
The dll has a global variable that keeps some state. I'm using a counter there to test this. My assumption is that after calling FreeLibrary and then trying to run again, any state I had in my library would be gone and so it would start over. But that's not what is happening. Rather, each time I run it, it appears to continue where it left off and not reset.
I see no errors and the FreeLibrary call is returning true.