View Issue Details

IDProjectCategoryView StatusLast Update
0005707JEDI VCL00 JVCL Componentspublic2011-11-09 19:51
ReportertetarddAssigned To 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version3.45 
Target VersionFixed in Version 
Summary0005707: TJvTreeView.OnAddition can cause app to crash at startup
DescriptionIt would appear the OnAddition event is fired when the app starts (main form's creation) if some items exist at design time (see attached demo). This is cause by the fact that in the event handler, if you access other controls, these might not yet have been created.
Additional InformationThe demo I included was originally to show a previous bugs I reported so ignore the other events, simply focus on OnAddition. If you left the code as is, no crash occurs:

procedure TForm7.JvTreeView1Addition(Sender: TObject; Node: TTreeNode);
begin
     If Memo1 <> Nil Then
          memo1.Lines.Add('Addition');
end;

However, if the code is the following (not test):

procedure TForm7.JvTreeView1Addition(Sender: TObject; Node: TTreeNode);
begin
     memo1.Lines.Add('Addition');
end;

Your app won't start.

I don't think it's good to have to force the code to check if a control present at design time has already been created or to rely on control creation order. Maybe the OnAddition event should not be fired if we are still in form creation stage.
TagsNo tags attached.

Activities

2011-11-09 10:38

 

Bug Jedi.zip (811,757 bytes)

tetardd

2011-11-09 10:47

reporter   ~0019104

Sorry, after more investigation, it's a VCL bug so I'm off filling a QC request.

D.

Issue History

Date Modified Username Field Change
2011-11-09 10:38 tetardd New Issue
2011-11-09 10:38 tetardd File Added: Bug Jedi.zip
2011-11-09 10:47 tetardd Note Added: 0019104
2011-11-09 19:51 AHUser Status new => closed
2011-11-09 19:51 AHUser Resolution open => fixed