From e1a466263a21873e2cf43deeec9aa6ba91cc3282 Mon Sep 17 00:00:00 2001 From: "olivier.sannier" Date: Fri, 11 Sep 2020 09:46:20 +0200 Subject: [PATCH] Use an indirect inline method to avoid NRE in echoes --- Source/TObject.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/TObject.pas b/Source/TObject.pas index 495826e..b9a8908 100644 --- a/Source/TObject.pas +++ b/Source/TObject.pas @@ -147,7 +147,12 @@ constructor Create; virtual; empty; method Destroy; virtual; empty; // can't use "destructor" because this project isn't built using Delphi Compatibility. same diff though. - method Free; + method Free; inline; // this allows writing SomeObject.Free without getting an NRE in Echoes + begin + self:InternalFree; + end; + + method InternalFree; begin if assigned(self) and not fDestroyed then begin fDestroyed := true;