[fpc-pascal] Need help fixing leaks

Thomas Schatzl tom_at_work at gmx.at
Tue Dec 21 09:26:51 CET 2010


On Mon, 20 Dec 2010 19:33:51 -0800 (PST), leledumbo
<leledumbo_cool at yahoo.co.id> wrote:
> [...]
> Program received signal SIGSEGV, Segmentation fault.
> 0x00000000 in ?? ()
> (gdb) bt
> #0  0x00000000 in ?? ()
> #1  0x00406c32 in SYSTEM_TOBJECT_$__FREE ()
> #2  0x0040d916 in TFPGOBJECTLIST$TLLVMVALUE__DEREF (ITEM=0x55138,
>     this=<error reading variable>) at llvmirbuilder.pp:362
> #3  0x00421451 in FGL_TFPSLIST_$__DEREF$LONGINT$LONGINT ()
> #4  0x00000000 in ?? ()
> That line is the end of a method and I have no idea why the item got
> dereferenced.

At least one issue seems to be that all your TFPGObjectLists are owners of
their respective instances. This leads to multiple attempted Free() calls
to the objects in the list. If I am correct, there are/will be up to three
Free() calls for some objects in your example code.

I may be wrong, I did not really debug the code, just from looking at it.


More information about the fpc-pascal mailing list