View Issue Details

IDProjectCategoryView StatusLast Update
0035028FPCRTLpublic2019-07-19 08:07
ReporterMartin Friebe Assigned ToSven Barth  
Status closedResolutionfixed 
Platform64bit IntelOSwin 10 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0035028: memory leak in Thread.Queue
DescriptionIf TThread.Queue is called in the main thread, then the event is executed immediately (rather than being queued for the next CheckSynchronize).

This is ok, but if the event throws on exception, then the memory for the event record is leaked:

procedure ThreadQueueAppend

  if (GetCurrentThreadID = MainThreadID) and (not aQueueIfMain or not IsMultiThread) then
    if not Assigned(aEntry^.SyncEvent) then
  end else begin

If in ExecuteThreadQueueEntry an exception occurs, then Dispose is never called.

In CheckSyncronize, the exception is caught, stored, and re-raised *afted* the dispose.
TagsNo tags attached.
Fixed in Revision41280
Attached Files


Sven Barth

2019-02-10 15:43

manager   ~0114011

Please test and close if okay.

Issue History

Date Modified Username Field Change
2019-02-06 21:37 Martin Friebe New Issue
2019-02-10 15:43 Sven Barth Fixed in Revision => 41280
2019-02-10 15:43 Sven Barth Note Added: 0114011
2019-02-10 15:43 Sven Barth Status new => resolved
2019-02-10 15:43 Sven Barth Fixed in Version => 3.3.1
2019-02-10 15:43 Sven Barth Resolution open => fixed
2019-02-10 15:43 Sven Barth Assigned To => Sven Barth
2019-02-10 20:44 Martin Friebe Status resolved => closed