View Issue Details

IDProjectCategoryView StatusLast Update
0020305LazarusIDEpublic2011-09-21 17:33
ReporterBart BroersmaAssigned ToJuha Manninen 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWindowsOS VersionWin7
Product Version0.9.31 (SVN)Product Buildr32433 
Target VersionFixed in Version0.9.30.1 (SVN) 
Summary0020305: Components View crash
DescriptionIn components view (Menu -> View -> Components, if you Tab to the list, but do not select anything, and then press Enter, the IDE crashes.

Program received signal SIGSEGV, Segmentation fault.
0x0071ee8f in TCOMPONENTLISTFORM__ADDSELECTEDCOMPONENT <
    ACOMPONENT=0xffffffff, this=<error reading variable>>
    at componentlis.pas: 301
Steps To ReproduceSee above.
Additional InformationIn the OnKeyDown procedure, when Key = VK_RETURN, then simply the DoubleClick handler is called, without checking if any item was selected at all.

I attached a possible fix.
TagsNo tags attached.
Fixed in Revisionr32446
LazTarget-
WidgetsetWin32/Win64
Attached Files
  • componentslist.pas.diff (487 bytes)
    Index: ide/componentlist.pas
    ===================================================================
    --- ide/componentlist.pas	(revision 32443)
    +++ ide/componentlist.pas	(working copy)
    @@ -326,7 +326,9 @@
       var Key: Word; Shift: TShiftState);
     begin
       if Key = VK_RETURN then
    -    ListboxComponentsDblClick(Sender);
    +  begin
    +    if (ListboxComponents.ItemIndex >= 0) then ListboxComponentsDblClick(Sender);
    +  end;
     end;
     
     procedure TComponentListForm.SetFocusToDataList;
    

Activities

2011-09-20 23:32

 

componentslist.pas.diff (487 bytes)
Index: ide/componentlist.pas
===================================================================
--- ide/componentlist.pas	(revision 32443)
+++ ide/componentlist.pas	(working copy)
@@ -326,7 +326,9 @@
   var Key: Word; Shift: TShiftState);
 begin
   if Key = VK_RETURN then
-    ListboxComponentsDblClick(Sender);
+  begin
+    if (ListboxComponents.ItemIndex >= 0) then ListboxComponentsDblClick(Sender);
+  end;
 end;
 
 procedure TComponentListForm.SetFocusToDataList;

Juha Manninen

2011-09-21 11:28

developer   ~0052078

Applied, thanks.

Bart Broersma

2011-09-21 17:33

developer   ~0052085

Fixed.

Issue History

Date Modified Username Field Change
2011-09-20 23:32 Bart Broersma New Issue
2011-09-20 23:32 Bart Broersma File Added: componentslist.pas.diff
2011-09-20 23:32 Bart Broersma LazTarget => -
2011-09-20 23:32 Bart Broersma Widgetset => Win32/Win64
2011-09-21 11:28 Juha Manninen Fixed in Revision => r32446
2011-09-21 11:28 Juha Manninen Status new => resolved
2011-09-21 11:28 Juha Manninen Resolution open => fixed
2011-09-21 11:28 Juha Manninen Assigned To => Juha Manninen
2011-09-21 11:28 Juha Manninen Note Added: 0052078
2011-09-21 17:33 Bart Broersma Status resolved => closed
2011-09-21 17:33 Bart Broersma Note Added: 0052085
2011-09-21 17:33 Bart Broersma Fixed in Version => 0.9.30.1 (SVN)