Unity will keep the Phidget library loaded in the editor after the first run, so you need to make sure things get closed and the library gets cleaned up before exiting your program.
The code below is already written when the application is closed.
The important thing is that the phidget control panel does not work even if the unity editor is open, not the phidget project.
------------------------------------------------------
void OnApplicationQuit()
{
if (Application.isEditor)
Phidget.ResetLibrary();
else
Phidget.FinalizeLibrary(0);
}