> I don't know what to try else. A new computer? :)

Try to fix the code...
Calling Free method without having first created the object will fails.
In other words, you simple code is simply wrong.
You should write something like:

procedure TForm.buttonclick(sneder: tobject);
var 
    t: tstringlist;
begin
    t := TStringList.Create;
    try
        // Do something with the string list
    finally
        t.free;  // Could be better to call FreeAndNil(t) instead
    end;
end;

--
[EMAIL PROTECTED]
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

----- Original Message ----- 
From: "CubicDesign" <[EMAIL PROTECTED]>
To: "undisclosed-recipients:"
Sent: Friday, July 11, 2008 9:18 PM
Subject: Application will never crash!!!


> Hi.
> 
> Recently I have discovered that my application will not crash if I run 
> this code with "compiler optimization" turned on.
> 
> Procedure TForm.buttonclick(sneder: tobject);
> Var t: tstringlist;
> Begin
>  t.free;
> End;
> 
> If I push the button that calls this code, the main for disappear but 
> the application still remains in memory. I have to use Ctrl+Alt+Del to 
> kill it.
> 
> I have reinstalled Delphi, but this still didn't fixed my problem. Then 
> I have reinstalled Windows, and again Delphi, without the Update1 and 
> without 3^rd part components or IDE experts. Still not working.
> 
> I don't know what to try else. A new computer? :)
> 
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://lists.elists.org/cgi-bin/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list -> [email protected]
http://lists.elists.org/cgi-bin/mailman/listinfo/delphi

Reply via email to