Page 2 of 7

Re: Game (unity3d) with phidgets hangs on close

Posted: Tue Dec 14, 2010 3:30 am
by seriousmedia
I've tried installing the latest version of unity3d with the latest phidget-drivers today and still no luck.
Strange thing is that when running in IDE-mode (run inside the development interface) closing is not a problem. Only when running the published .exe file.
Also when i just create the 'interfaceKit' object and attach an event-handler (attachEventHandler for example) and then don't call the open method, everything closes fine.

Anyone know what to test next?

Re: Game (unity3d) with phidgets hangs on close

Posted: Tue Dec 14, 2010 10:16 am
by Patrick
What happens if you don't call close? It may not be necessary in your case - you really only need to worry about it if you want to close and then open multiple times in one program run. The Phidgets will be released when the program exits. Also, close is called and the handle is cleaned up in the class finalize method which gets called from garbage collection.

-Patrick

Re: Game (unity3d) with phidgets hangs on close

Posted: Tue Dec 14, 2010 1:37 pm
by seriousmedia
not calling close does not make a difference, unfortunately.

Re: Game (unity3d) with phidgets hangs on close

Posted: Wed Dec 22, 2010 2:50 am
by seriousmedia
When running the simpified version (just connecting to the phidget) in the unity3D IDE, it closes fine and connects fine the following times.
Just when i publish the unity3D and then run it, i can't close it without hanging.

edit: When closing the Unity3D IDE it hangs :-(

Re: Game (unity3d) with phidgets hangs on close

Posted: Wed Dec 22, 2010 10:08 am
by Patrick
What if you don't register any even handlers? Also, what type of Object owns the Phidget object?

-Patrick

Re: Game (unity3d) with phidgets hangs on close

Posted: Thu Dec 23, 2010 2:31 am
by seriousmedia
If i don't register any event-handlers it still hangs.
The phidget interfaceKit object is a owned by a MonoBehaviour object in Unity (scripting in unity3d is handled in Mono).

Re: Game (unity3d) with phidgets hangs on close

Posted: Mon Apr 18, 2011 3:01 pm
by janoonk
We got the exact same problem. Unity hangs if you want to quit it.
Fortunately you can run your project multiple times without hanging/restarting.

Re: Game (unity3d) with phidgets hangs on close

Posted: Wed Apr 11, 2012 10:22 am
by dengfengsoft
How about killing the process like the following method in C#:
void KillMe()
{
string proc=Process.GetCurrentProcess().ProcessName;
Process[] processes=Process.GetProcessesByName(proc);
for(int i=0;i<processes.Length;i++)
{
processes.Kill();
}
}

Re: Game (unity3d) with phidgets hangs on close

Posted: Mon May 21, 2012 12:23 pm
by noisecrime
Just got my phidgets Interfacekit 8/8/8 to work with sonar sensors in Unity and find I have exactly the same problem.

Everything works flawlessly with the hardware and Unity, except that once you have simply 'opened' a connection to the interface any subsequent attempt to quit Unity or built applications will cause them to hang indefinitely.

What will it take to get this resolved?

Very disappointed that an almost 2 year old thread about this bug has never been addressed with a solution.

I'm very fearful that phidgets will blame Unity and Unity will blame Phidgets with the end result that nothing will ever be resolved and thus making phidgets useless for use with Unity.

I'm more than willing to help in trying to debug this, but with the phidgets .NET dll being closed source and Unity likewise it will be very difficult to get debug information.

I did activate phidgets verbose logging, but it doesn't show any particular problems.

Please help.

Re: Game (unity3d) with phidgets hangs on close

Posted: Wed Jun 06, 2012 1:57 pm
by Patrick
Hi,

This bug has been fixed, as of today's release (2.1.8.20120606).

-Patrick