> There should be only 1 load/unload (when the core is initialized and > deinitialized by host) and the whole DLL is wiped in the process, so I think > maybe the libretro host kind of takes care of that, but I could be > misunderstanding.
The problem is that when a dynamic library is unloaded the memory it allocated won't get automatically freed. This isn't done until the program itself quits. I've created [an issue](https://github.com/nim-lang/Nim/issues/21403) to track this, once that is implemented it should be completely safe to load and unload dynamic libraries written in Nim.