I was able to reproduce this issue. The reason for the crash is that when you make the second call, mIRC notices that the DLL is already loaded, calls it, and then immediately unloads it because the keep flag is false. When it returns to continue processing the first dll call, the dll has been unloaded.

The LoadDLL function should really only perform initialization of settings and should return the keep value to mIRC so that it can be processed when mIRC first loads the DLL and initializes its own internal settings.

That said, I'll add an extra check to prevent mIRC from unloading the DLL in this particular situation.