From d20c0908d8580152c731ab792e8784a3e6a7ee0b Mon Sep 17 00:00:00 2001 From: Martin Date: Sun, 22 Sep 2024 17:05:46 +0200 Subject: [PATCH] IdeDebugger: fix detecting if current watch was freed. (cherry picked from commit 5192cd95d94251bfd29de9a0af788d4cdc25a396) --- ide/packages/idedebugger/debugger.pp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ide/packages/idedebugger/debugger.pp b/ide/packages/idedebugger/debugger.pp index 91d0a1a2c3..9677533b33 100644 --- a/ide/packages/idedebugger/debugger.pp +++ b/ide/packages/idedebugger/debugger.pp @@ -557,6 +557,7 @@ type const AThreadId: Integer; const AStackFrame: Integer ); + destructor Destroy; override; procedure Assign(AnOther: TWatchValue); override; property Watch: TIdeWatch read GetWatch; @@ -4596,6 +4597,13 @@ begin FStackFrame := AStackFrame; end; +destructor TIdeWatchValue.Destroy; +begin + inc(DbgStateChangeCounter); + if DbgStateChangeCounter = high(DbgStateChangeCounter) then DbgStateChangeCounter := 0; + inherited Destroy; +end; + procedure TIdeWatchValue.Assign(AnOther: TWatchValue); begin inherited Assign(AnOther);