View Issue Details

IDProjectCategoryView StatusLast Update
0006050JEDI VCL99 Otherpublic2014-12-04 16:33
ReporterdavedelageAssigned Toobones 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionsuspended 
Product Version3.45 
Target VersionFixed in Version 
Summary0006050: Hid Demo reset crash
DescriptionDevice 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...

TagsNo tags attached.

Activities

obones

2013-01-15 14:59

administrator   ~0020335

Can you give a bit more details on the crash itself, ie where it occurs?

davedelage

2013-01-15 18:31

reporter   ~0020393

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.

obones

2013-12-13 16:51

administrator   ~0020838

Please try again with the current GIT/daily content, I'm not seeing this code at all

obones

2014-12-04 16:33

administrator   ~0021119

No news, suspending the issue

Issue History

Date Modified Username Field Change
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