Project JEDI - Issue Tracker - JEDI VCL
Viewing Issue Advanced Details
6050 99 Other minor always 2012-12-20 16:35 2014-12-04 16:33
davedelage  
obones  
normal  
resolved 3.45  
suspended  
none    
none  
0006050: Hid Demo reset crash
Device reset (reset button on the external device) of the active HID device causes crash.

This code in DevReader.pas
procedure TMainForm.DevListBoxClick(Sender: TObject);
var
  I: Integer;
  Dev: TJvHidDevice;
begin
  // stop reader thread
  if Assigned(CurrentDevice) then
    CurrentDevice.OnData := nil;
  CurrentDevice := nil;
  WriteBtn.Enabled := False;
   etc....

should be

procedure TMainForm.DevListBoxClick(Sender: TObject);
var
  I: Integer;
  Dev: TJvHidDevice;
begin
  // stop reader thread
  if Assigned(CurrentDevice) then
  begin
    CurrentDevice.OnData := nil;
    CurrentDevice := nil; //thus including this line in the if-then
  end;
  WriteBtn.Enabled := False;
   etc...

Issue History
2012-12-20 16:35 davedelage New Issue
2013-01-15 14:59 obones Note Added: 0020335
2013-01-15 14:59 obones Status new => feedback
2013-01-15 18:31 davedelage Note Added: 0020393
2013-12-13 11:38 obones Status feedback => acknowledged
2013-12-13 16:51 obones Note Added: 0020838
2013-12-13 16:51 obones Status acknowledged => feedback
2014-12-04 16:33 obones Note Added: 0021119
2014-12-04 16:33 obones Status feedback => resolved
2014-12-04 16:33 obones Resolution open => suspended
2014-12-04 16:33 obones Assigned To => obones

Notes
(0020335)
obones   
2013-01-15 14:59   
Can you give a bit more details on the crash itself, ie where it occurs?
(0020393)
davedelage   
2013-01-15 18:31   
I'm not sure what you are requesting but I will attempt to answer.

When operating the HidDemo board from CCS, all is well until I press the Reset button on the demo board which causes an immediate crash which occurs at line 154 of DevReader.pas which is in jvcl\examples\JvHIDController\ReadWriteDemo.

In my original issue I noted not only the code in the area of the error as supplied, but the simple code change that would (and did) fix the problem.

In lay speak, don't try to set a device nil when the device doesn't exist.

Hope this helps, please let me know if I didn't actually answer your question.
(0020838)
obones   
2013-12-13 16:51   
Please try again with the current GIT/daily content, I'm not seeing this code at all
(0021119)
obones   
2014-12-04 16:33   
No news, suspending the issue