Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Compiler/Delphi/Code Generation/Optimization    [ Add a report in this area ]  
Report #:  122274   Status: Closed
Access Violation with array[1..10] of TBookMark
Project:  Delphi Build #:  19.0.14356.6604
Version:    19.2 Submitted By:   Michele Angelotti
Report Type:  Crash / Data loss / Total failure Date Reported:  2/6/2014 1:36:16 AM
Severity:    Infrequently encountered problem Last Updated: 4/15/2014 6:32:15 PM
Platform:    All versions Internal Tracking #:   47346
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE6
Duplicate of:  None
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: 10
Description
When I try to close a application, I get an Access Violation.

This problem occurs with Delphi XE4 and Delphi XE5, the previous release was compiled with Delphi XE and the problem doesn't occurs
Steps to Reproduce:
1. Create new VCL form application
2. Declare in private session an array of TBookMark (aPosition: array[1..10] of TBookmark)
3. Run and close it

[Data.DB.pas]
--------
...
{ TDataSet }

  TBookmark = TArray<Byte>;
  ...
--------

[Sample VCL application]
------------
type
  TForm2 = class(TForm)
    Button1: TButton;
    ClientDataSet1: TClientDataSet;
    procedure Button1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
    aTbPos: array[1..10] of TBookMark; // <<<------- Access Violation WHEN CLOSING app
    // aTbPos: array of TBookMark; <-- WORKS
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.FormShow(Sender: TObject);
begin
  // SetLength(aTbPos,10); <-- WORKS
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
  Close;
end;
------------
Workarounds
I've resolved this issue replacing my static array with a dynamic one (aPosition: array of TBookmark)
Attachment
122274.zip
Comments

None

Server Response from: ETNACODE01