- Home /
Unity editor stalling on second attempt to play
I am attempting to use a Tobii TX300 eye-tracker as an input device for Unity. This device is connected via LAN (TCP connection managed by Tobii SDK). The Tobii SDK has appropriate methods (I am writing in C#/mono) for opening and closing connections with the device.
I can 'play' my application once within the Unity editor and everything works as expected, but on the second attempt to 'play' the game, the editor stalls. The problem also occurs if I am currently playing the game in the editor, and then synchronize any code changes. I notice that this thread remains open:
mono.dll!mono_unity_socket_security_enabled_set+0x1e04 (there are usually at least 3-4 threads with the same name, but one always consumes a higher amount of cpu).
If I kill it manually using ProcessHacker then the Unity editor resumes normal operation.
The problem also occurs if I build the application into an executable. The game will play fine, but as soon as I attempt to exit then the application freezes, and I have to manually kill the process.
void Start ()
{
Library.Init();
eyeTracker = EyetrackerFactory.CreateEyetracker(SERVER, SERVER_PORT, SYNC_PORT, EventThreadingOptions.BackgroundThread);
eyeTracker.StartTracking();
}
void OnApplicationQuit()
{
eyeTracker.StopTracking();
eyeTracker.Dispose();
}
Does anyone have any suggestions on why this thread is remaining open, or how to release resources within Unity scripts?
Seems you haven't gotten an answer yet. Try http://gamedev.stackexchange.com/ I typically get faster results.
Is there a call like Library.UnInit() ? I find that these things happen when you don't stop a process that is ongoing and calling to an external dll.
No, unfortunately. I have contacted the Tobii $$anonymous$$m regarding how to correctly $$anonymous$$r down their system but have yet to get a response. Their demonstration code disposes of the eyeTracker just like I have done.
Are you aware of any other way of monitoring these processes, i.e. does Unity keep a register of child threads/processes?
I have never seen a monitor like that. $$anonymous$$aybe you should start a new post asking for something like that. Best of luck.