Last active
January 4, 2016 10:39
-
-
Save tdelphi/8609918 to your computer and use it in GitHub Desktop.
example of using freed objet in Delphi. Works without any errors in D6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
program programThatUsesFreedObject; | |
{$APPTYPE CONSOLE} | |
uses | |
Classes, | |
SysUtils; | |
var | |
tmpSL: TStringList; | |
begin | |
try | |
tmpSL := TStringList.Create; | |
tmpSL.Free; | |
tmpSL.Delimiter := '?'; | |
Writeln('we just used freed object without any consequences: '+tmpSL.Delimiter); | |
except | |
on E: Exception do | |
writeln(E.Message); | |
end; | |
Readln; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment