Skip to content

Commit 66386b7

Browse files
committed
Defer automatic unload to OnDestroy (#8)
1 parent 2372c00 commit 66386b7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/DllManipulatorScript.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ private void OnEnable()
8484
InitializationTime = timer.Elapsed;
8585
}
8686

87-
private void OnApplicationQuit()
87+
private void OnDestroy()
8888
{
89-
//FIXME: Because we don't wait for other threads to finish, we might be stealing function delegates from under their nose if Unity doesn't happen to close them yet.
89+
//Note on threading: Because we don't wait for other threads to finish, we might be stealing function delegates from under their nose if Unity doesn't happen to close them yet.
9090
//On Preloaded mode this leads to NullReferenceException, but on Lazy mode the DLL and function would be just reloaded so we would up with loaded DLL after game exit.
9191
//Thankfully thread safety with Lazy mode is not implemented yet.
9292

0 commit comments

Comments
 (0)