[fpc-devel] TObjectList crash!

Paul Ishenin ip at kmiac.ru
Tue Sep 9 07:48:30 CEST 2008


Hello,  FPC developers' list.

We are preparing a next lazarus version and our users are heavily 
testing thing. One bug report let me found one error which is not a 
lazarus error, but fpc. This error happen because we used TObjectList to 
store bitmaps in a list.

TObjectList is a useful thing - we dont need to think about object 
destroying. They will be destroyed on deleting from the list. And 
everyting works except next call: AList[AIndex] := NewObject

I attached a test projects which shows a bug.

But in few words this bug happen due to double object destroying:
1. In TObjectList.SetItem (this is *not correct* place to destroy)
2. In TObjectList.Notify (this is *correct* place to destroy)

A solution is simple: remove everything from TObjectList.SetItem except 
Put call.

--
Best regards,
Paul Ishenin.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fpc_object_list_bug.lpr
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20080909/92906414/attachment.ksh>


More information about the fpc-devel mailing list