Game (unity3d) with phidgets hangs on close

Supporting Visual Studio on Windows
Post Reply
seriousmedia

Re: Game (unity3d) with phidgets hangs on close

Post 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?
User avatar
Patrick
Lead Developer
Posts: 615
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Game (unity3d) with phidgets hangs on close

Post 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
seriousmedia

Re: Game (unity3d) with phidgets hangs on close

Post by seriousmedia »

not calling close does not make a difference, unfortunately.
seriousmedia

Re: Game (unity3d) with phidgets hangs on close

Post 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 :-(
User avatar
Patrick
Lead Developer
Posts: 615
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Game (unity3d) with phidgets hangs on close

Post by Patrick »

What if you don't register any even handlers? Also, what type of Object owns the Phidget object?

-Patrick
seriousmedia

Re: Game (unity3d) with phidgets hangs on close

Post 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).
janoonk

Re: Game (unity3d) with phidgets hangs on close

Post 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.
dengfengsoft
Fresh meat
Posts: 4
Joined: Thu Feb 10, 2011 8:33 pm
Contact:

Re: Game (unity3d) with phidgets hangs on close

Post 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();
}
}
noisecrime
Fresh meat
Posts: 1
Joined: Mon May 21, 2012 12:15 pm
Contact:

Re: Game (unity3d) with phidgets hangs on close

Post 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.
User avatar
Patrick
Lead Developer
Posts: 615
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Game (unity3d) with phidgets hangs on close

Post by Patrick »

Hi,

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

-Patrick
Post Reply

Who is online

Users browsing this forum: No registered users and 29 guests