You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/DllManipulatorScript.cs
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -86,13 +86,16 @@ private void OnEnable()
86
86
87
87
privatevoidOnDestroy()
88
88
{
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.
90
-
//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.
91
-
//Thankfully thread safety with Lazy mode is not implemented yet.
89
+
if(_singletonInstance==this)
90
+
{
91
+
//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.
92
+
//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.
93
+
//Thankfully thread safety with Lazy mode is not implemented yet.
0 commit comments