diff --git a/Source/BoldElements.pas b/Source/BoldElements.pas index 7de6606..b190f35 100644 --- a/Source/BoldElements.pas +++ b/Source/BoldElements.pas @@ -974,11 +974,16 @@ constructor TBoldExternalVariable.Create(AEvaluator: TBoldEvaluator; const AName end; destructor TBoldExternalVariable.Destroy; +var + vEvaluator: TBoldEvaluator; begin fSubscriber.Free; - if Assigned(fEvaluator) then - fEvaluator.UndefineVariable(self); - fEvaluator := nil; + vEvaluator := fEvaluator; + if Assigned(vEvaluator) then + begin + fEvaluator := nil; + vEvaluator.UndefineVariable(self); + end; inherited; end;