<div dir="auto"><div><div class="gmail_extra"><div class="gmail_quote">Am 03.01.2018 12:32 schrieb "Tony Whyman" <<a href="mailto:tony.whyman@mccallumwhyman.com">tony.whyman@mccallumwhyman.com</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
function CheckSynchronize(...)<br>
<br>
and this ends with:<br>
<br>
else<br>
begin<br>
{ for Queue entries we dispose the entry and raise the exception }<br>
Dispose(tmpentry);<br>
if Assigned(exceptobj) then<br>
raise exceptobj;<br>
end;<br>
tmpentry := PopThreadQueueHead;<br>
end;<br>
<br>
The line "Dispose(tmpentry);" also disposes of a SynchronizeEvent but, unlike TThread.DoneSynchronizeEvent, there is no RtlEventDestroy.<br>
<br>
Am I correct in pointing the finger here for the memory leak?<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">I know you already found your problem, but nevertheless as explanation: this code is only reached by asynchronously added events (TThread.Queue()) and there no event is needed, this none is freed or even allocated. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div></div></div>