rusty_v8
rusty_v8 copied to clipboard
v8 may cause dynamic link libraries to not be released even after FreeLibrary
I have to use v8 as DLL in Windows. However, when I did a FreeLibrary, I found that my process still holds the library. I tried to drop Isolate and global context before calling FreeLibrary, but it did no good. What's the recommended way to gracefully shutdown the engine then? Thanks.
unloading dynamic libraries is generally not supported. you can simply exit the process after deinitializing V8.
Is this a limitation in the v8 engine or just rusty_v8?
this is a limitation of most dynamic libraries in general. you need to build them with special linker flags and ensure everything has proper destructors and etc. and its not done very often because there is not usually any reason to unload them. are you hitting a specific issue requiring you to unload v8?
Yes, I am using it in the Unity editor. Whenever I make some modifications in v8, I must restart the Unity editor. If this is not supported, I have a workaround to just copy the DLL, and Load the copied one to make sure the original one can be updated every time.