2
Vote

WM 5: Application quits after detection timeout.

description

While running on Windows Mobile 5 -if the detection timeouts (because of short timeout or whatever reason) and starts canceling, the following debug info is printed by GPS.NET:
 
GPS.Net: Canceling device detection
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
GPS.Net: Aborting all device detection threads
GPS.Net: Aborting detection thread for GPS Intermediate Driver (Device on COM8:)
A first chance exception of type 'System.NullReferenceException' occurred in GeoFramework.Gps.PocketPC.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in System.Windows.Forms.dll
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in System.dll
 
and than the exception causes parent application to exit.
I think I tracked down the problem, it appears to be around lines 1128-1132 in Devices.cs, especially two lines: "for (int index = 0; index < _BluetoothDevices.Count; index++)" and "for (int index = 0; index < _SerialDevices.Count; index++)"
I'd recommend changing them to: "for (int index = 0; (_BluetoothDevices != null) && index < _BluetoothDevices.Count; index++)" and "for (int index = 0; (_SerialDevices != null) && index < _SerialDevices.Count; index++)" respectively.
 
Regards,
Piotr.

comments

timowilson wrote Nov 1, 2010 at 7:34 PM

This error will also happen if you set the property Devices.IsOnlyFirstDeviceDetected to true prior to starting the interpreter.

wrote Nov 1, 2010 at 7:35 PM

wrote Feb 21, 2013 at 11:51 PM