diff --git a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas index eab750d2c1..b89f0f3d22 100644 --- a/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas +++ b/components/lazdebuggers/lazdebuggerfp/fpdebugdebugger.pas @@ -1402,7 +1402,11 @@ begin if AWatchValue <> nil then begin AWatchValue.Value := AResText; //IntToStr(APasExpr.ResultValue.AsInteger); - AWatchValue.Validity := ddsValid; + AWatchValue.TypeInfo := ATypeInfo; + if IsError(ResValue.LastError) then + AWatchValue.Validity := ddsError + else + AWatchValue.Validity := ddsValid; end; end else @@ -1410,6 +1414,7 @@ begin AResText := 'Error'; if AWatchValue <> nil then AWatchValue.Validity := ddsInvalid; + FreeAndNil(ATypeInfo); end; end; finally @@ -1485,7 +1490,6 @@ begin WatchValue.RemoveFreeNotification(@DoWatchFreed); EvaluateExpression(WatchValue, WatchValue.Expression, AVal, AType); - AType.Free; if (not FWatchAsyncQueued) and (FWatchEvalList.Count > 0) then begin