mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 16:55:55 +02:00
LazDebuggerFp: improve error handling
This commit is contained in:
parent
c8d378a70d
commit
552fd1dce8
@ -1032,13 +1032,15 @@ end;
|
||||
procedure TFpThreadWorkerWatchValueEvalUpdate.UpdateWatch_DecRef(Data: PtrInt);
|
||||
var
|
||||
dbg: TFpDebugDebuggerBase;
|
||||
w: TWatchValueIntf;
|
||||
begin
|
||||
assert(system.ThreadID = classes.MainThreadID, 'TFpThreadWorkerWatchValueEval.UpdateWatch_DecRef: system.ThreadID = classes.MainThreadID');
|
||||
|
||||
if FWatchValue <> nil then begin
|
||||
FWatchValue.RemoveNotification(weeCancel, @DoWachCanceled);
|
||||
FWatchValue.EndUpdate;
|
||||
w := FWatchValue;
|
||||
FWatchValue := nil;
|
||||
w.RemoveNotification(weeCancel, @DoWachCanceled);
|
||||
w.EndUpdate;
|
||||
end;
|
||||
|
||||
dbg := FDebugger;
|
||||
@ -1047,13 +1049,16 @@ begin
|
||||
end;
|
||||
|
||||
procedure TFpThreadWorkerWatchValueEvalUpdate.DoRemovedFromLinkedList;
|
||||
var
|
||||
w: TWatchValueIntf;
|
||||
begin
|
||||
if FWatchValue <> nil then begin
|
||||
FWatchValue.RemoveNotification(weeCancel, @DoWachCanceled);
|
||||
if FWatchValue.Validity = ddsRequested then
|
||||
FWatchValue.Validity := ddsInvalid;
|
||||
FWatchValue.EndUpdate;
|
||||
FWatchValue := nil;
|
||||
w := FWatchValue;
|
||||
w.RemoveNotification(weeCancel, @DoWachCanceled);
|
||||
if w.Validity = ddsRequested then
|
||||
w.Validity := ddsInvalid;
|
||||
w.EndUpdate;
|
||||
end;
|
||||
UnQueue_DecRef;
|
||||
end;
|
||||
|
@ -423,14 +423,17 @@ begin
|
||||
exit;
|
||||
FLocked := True;
|
||||
WorkItem := FNextWorker;
|
||||
try
|
||||
while (WorkItem <> nil) and (WorkItem.RefCount = 1) do begin
|
||||
w := WorkItem;
|
||||
WorkItem := w.FNextWorker;
|
||||
w.DoRemovedFromLinkedList;
|
||||
w.DecRef;
|
||||
end;
|
||||
finally
|
||||
FNextWorker := WorkItem;
|
||||
FLocked := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TFpDbgDebggerThreadWorkerLinkedList.RequestStopForWorkers;
|
||||
@ -456,6 +459,7 @@ begin
|
||||
FLocked := True;
|
||||
WorkItem := FNextWorker;
|
||||
FNextWorker := nil;
|
||||
try
|
||||
while (WorkItem <> nil) do begin
|
||||
w := WorkItem;
|
||||
WorkItem := w.FNextWorker;
|
||||
@ -466,7 +470,9 @@ begin
|
||||
w.DoRemovedFromLinkedList;
|
||||
w.DecRef;
|
||||
end;
|
||||
finally
|
||||
FLocked := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
{ TFpThreadWorkerControllerRun }
|
||||
|
Loading…
Reference in New Issue
Block a user