Unity plugin causing hangs when Reloading Domain

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
avg3dMouseEnjoyer
Posts: 2
Joined: Fri Mar 14, 2025 9:46 am

Unity plugin causing hangs when Reloading Domain

Post by avg3dMouseEnjoyer »

Hello, your plugin for unity(3DxUnity3D) is causing 6 to 10 second hangs when entering game mode (because of the unloading and reloading domain, specifically the unloading part). This is extremely frustrating because it increases development time.

I have profiled Unity with your plugin and it looks like the disposing(closing) of your classes seem to be the culprit causing the hangs, disabling your plugin removes the hangs:

TDxNavLib.dll!NlClose
TDx.SpaceMouse.Navigation3D.dll!.NativeMethods.NlClose
TDx.SpaceMouse.Navigation3D.dll!TDx.SpaceMouse.Navigation3D.NativeNavlibWrapper.Close
TDx.SpaceMouse.Navigation3D.dll!TDx.SpaceMouse.Navigation3D.NativeNavlibWrapper.Dispose
TDx.SpaceMouse.Navigation3D.dll!TDx.SpaceMouse.Navigation3D.NativeNavlibWrapper.Finalize

Here is a stacktrace of an exception that occurs about 50% of the time when trying to dispose of the class, this might be part of the issue:

System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'NativeNavlibWrapper'.
at TDx.SpaceMouse.Navigation3D.NativeNavlibWrapper.Close () [0x00008] in <fcbcc8a5b031496896cbc0cf1e64d310>:0
at TDx.SpaceMouse.Navigation3D.Navigation3D.Close () [0x0002a] in <fcbcc8a5b031496896cbc0cf1e64d310>:0
at TDxUnity3D.CameraController.CloseConnection () [0x000b0] in C:\3DConnexion\3DxUnity3D\src\Editor\TDxController.cs:124
at TDxUnity3D.CameraController.Finalize () [0x00024] in C:\3DConnexion\3DxUnity3D\src\Editor\TDxController.cs:134

For additional information about the Unity Domain Reloading you can view these pages:
https://docs.unity3d.com/6000.2/Documen ... tails.html
https://docs.unity3d.com/Manual/configu ... -mode.html

I'm using Unity version 6000.0.41f1 and can provide more technical information if required.

Please look into this, thank you!
avg3dMouseEnjoyer
Posts: 2
Joined: Fri Mar 14, 2025 9:46 am

Re: Unity plugin causing hangs when Reloading Domain

Post by avg3dMouseEnjoyer »

I would like to add that SendMessageTimeoutW is called 3x by TDxNavLib.dll further down the TDxNavLib.dll!NlClose call, and each of these calls have a 2 second timeout resulting in a total 6 seconds. This explains why it hangs for 6+ seconds.
Post Reply