View Issue Details

IDProjectCategoryView StatusLast Update
0019389LazarusIDEpublic2011-05-21 12:34
ReporterLudo BrandsAssigned ToMaxim Ganetsky 
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Product Version0.9.31 (SVN)Product Build 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0019389: Code tools defines editor ... Insert template crashes IDE
DescriptionSelect any template and IDE crashes with Access violation.

Narrowed the problem down to TInputFileDialog.Create. rsFormResourceSNotFoundForResourcelessFormsCreateNew is raised in TCustomForm.Create and causes TInputFileDialog.Destroy to execute immediately. DeleteAllLabels references FInputLabels which hasn't been created yet => access violation.

The problem has been introduced with the introduction of rsFormResourceSNotFoundForResourcelessFormsCreateNew exception and RequireDerivedFormResource that is set to True in lazarus.pp. When TInputFileDialog.Create is modified to

constructor TInputFileDialog.Create(TheOwner: TComponent);
begin
  RequireDerivedFormResource:=false ;
  inherited Create(TheOwner);
  RequireDerivedFormResource:=true;

the problem is solved. I don't know why RequireDerivedFormResource was introduced and set to true for lazarus. Hence, I guess the above work around is just that and not the best solution.
TagsNo tags attached.
Fixed in Revision30831
LazTarget-
WidgetsetGTK 2, Win32/Win64
Attached Files

Activities

Dirk Schiphorst

2011-05-20 18:19

reporter   ~0048448

See http://lists.lazarus.freepascal.org/pipermail/lazarus/2011-February/060229.html and / or http://wiki.lazarus.freepascal.org/Lazarus_0.99.0_release_notes#TCustomForm.Create_raises_an_exception_if_resource_is_not_found

So Create() should have been replaced by CreateNew() but probably slipped through the net.

Ludo Brands

2011-05-20 18:35

developer   ~0048449

Hadn't seen that one. And yes, inherited CreateNew() in constructor TInputFileDialog.Create does solve the problem.

Maxim Ganetsky

2011-05-21 00:40

developer   ~0048459

Please test and close if ok.

Ludo Brands

2011-05-21 12:34

developer   ~0048466

OK. Tested win32 and GTK2

Issue History

Date Modified Username Field Change
2011-05-20 17:53 Ludo Brands New Issue
2011-05-20 17:53 Ludo Brands Widgetset => GTK 2, Win32/Win64
2011-05-20 18:19 Dirk Schiphorst Note Added: 0048448
2011-05-20 18:35 Ludo Brands Note Added: 0048449
2011-05-21 00:39 Maxim Ganetsky Fixed in Revision => 30831
2011-05-21 00:39 Maxim Ganetsky LazTarget => -
2011-05-21 00:39 Maxim Ganetsky Status new => resolved
2011-05-21 00:39 Maxim Ganetsky Fixed in Version => 0.9.31 (SVN)
2011-05-21 00:39 Maxim Ganetsky Resolution open => fixed
2011-05-21 00:39 Maxim Ganetsky Assigned To => Maxim Ganetsky
2011-05-21 00:40 Maxim Ganetsky Note Added: 0048459
2011-05-21 12:34 Ludo Brands Status resolved => closed
2011-05-21 12:34 Ludo Brands Note Added: 0048466