-
Notifications
You must be signed in to change notification settings - Fork 146
Open
Description
No idea if I can make reproducible case out of this, most likely not, but I have situation when I put stuff in the Queue, canel the multithreaded process.
TOmniValueQueue.Destroy gets called, on FreeAndNil(FInnerQueue);
calls to the TOmniValueQueue.CollectionNotifyEvent starts firing, and the FInnerQueue is freed in this point.
made following change to the procedure
procedure TOmniValueQueue.CollectionNotifyEvent(Sender: TObject;
const Item: TOmniValue; Action: TCollectionNotification);
var
AfterCount: integer;
begin
// This method occurs within the critical section.
AfterCount := -1; // <- Change starts
if Assigned(FInnerQueue) then
AfterCount := FInnerQueue.Count; // <- Change ends
Maybe this should be handled earlier, or ion completely other way, in TOmniValueQueue or in my code. but it seems that this will get rid of Access Violation, or the destructor TOmniValueQueue.Destroy; should firs clear the Queue, before releasing FInnerQueue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels