<p>Am 02.06.2016 15:03 schrieb "Stefan Schalk" <<a href="mailto:schalk.stefan@googlemail.com">schalk.stefan@googlemail.com</a>>:<br>
><br>
><br>
>    Hi Sven,<br>
><br>
> many thanks for your quick response and solution!<br>
><br>
> I tried the new FPC sources (Revision 33878) and ran in a segmentation fault.<br>
> In classes.inc line 345 the SizeOf gets the length from the pointer but I think<br>
> the length of the structure is needed:<br>
><br>
>     currently: FillChar(syncentry^, SizeOf(syncentry), 0);<br>
><br>
>     suggestion: FillChar(syncentry^, SizeOf(TThreadQueueEntry), 0);<br>
><br>
> Because of that, the uninitialized structure member "Next" will lead to a<br>
> segmentation fault afterwards.<br>
> I tried the suggestion and everything works fine (no SIGSEGV, no memory leak).<br>
> Can you please review my suggestion?</p>
<p>You're indeed right. Fixed that.</p>
<p>Though this whole fix won't be part of 3.0.2 anymore as it got discovered (and fixed) too late.</p>
<p>As a workaround try to avoid calling Synchronize from a new external thread each time. If it is the same thread then memory usage won't increase after the first call.</p>
<p>Regards,<br>
Sven</p>