Discuss Error in class allocation? in the Delphi Programming forum on Dev Shed. Error in class allocation? Delphi Programming forum discussing Delphi related topics including Kylix, C++ Builder, and more. Delphi is a high-performance language, originally based on the PASCAL language.
Posts: 32
Time spent in forums: 6 h 27 m 20 sec
Reputation Power: 1
Unfortunately this is not the case. See below:
.
.
idSistema: Integer;
implementation
uses UptFunc, Upt60101, UptDTM, Upt60102;
{$R *.DFM}
procedure TFrmUpt60100.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
FrmUpt60100 := nil;
end;
.
.
. Thank you very much
Posts: 2,045
Time spent in forums: 1 Week 6 Days 2 h 37 m
Reputation Power: 382
Quote:
Originally Posted by clivew
I think you need to remove this:
Code:
FrmUpt60100 := nil;
You are setting the pointer to your object to nil before it has been destroyed.
Comments on this post
Luthfi disagrees: Since it is destroyed, there is no harm to "reset" references to the destroyed object.
Clivew believes Luthfi is wrong.
The form has not been destroyed before the formClose event has returned, so setting the form pointer to nil inside that event is unwise at the very least.