App crash on close - using DBGrid/DBNavigator
Posted: Tue Jun 15, 2021 1:56 pm
Using DBGrid or DBNavigator in an App results in a crash (0xc0000005) when closing the app. Just placing one of these components on the main form leads to the error.
WIN 10 64 bit
CEF 90.6.7
Delphi 10.4.2
32-bit version of SimpleBrowser demo
further information:
Use of class constructor and FButtonsImageCollection used by tDBGrid/tDBNavigator triggers the problem. Using the following code in the demo the app crashes as well.
WIN 10 64 bit
CEF 90.6.7
Delphi 10.4.2
32-bit version of SimpleBrowser demo
further information:
Use of class constructor and FButtonsImageCollection used by tDBGrid/tDBNavigator triggers the problem. Using the following code in the demo the app crashes as well.
Code: Select all
interface
uses ...,Vcl.ImageCollection;
type
TForm1 = class(TForm)
ChromiumWindow1: TChromiumWindow;
...
end;
tClassConstructorTest = class(TObject)
class var FButtonsImageCollection: TImageCollection;
class constructor Create;
class destructor Destroy;
end;
implementation
uses
uCEFApplication, vcl.DBCtrls;
{ tClassConstructorTest }
class constructor tClassConstructorTest.Create;
procedure InitButtonsImageCollection;
begin
FButtonsImageCollection := TImageCollection.Create(nil);
FButtonsImageCollection.Add('FIRST', HInstance, 'DBN_' + 'FIRST', ['', '_20X']); //this line triggers the problem
end;
begin
InitButtonsImageCollection;
end;
class destructor tClassConstructorTest.Destroy;
begin
FreeAndNil(FButtonsImageCollection);
end;
...
procedure TForm1.FormCreate(Sender: TObject);
var
IntCCT: tClassConstructorTest;
begin
FCanClose := False;
FClosing := False;
IntCCT := tClassConstructorTest.Create;
FreeAndNil(IntCCT);
// The browser will load the URL in AddressEdt initially.
end;
...