[fpc-devel] TObjectList crash!
Michael Van Canneyt
michael at freepascal.org
Tue Sep 9 08:46:42 CEST 2008
On Tue, 9 Sep 2008, Paul Ishenin wrote:
> 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.
Confirmed, patched as suggested and tested. Revision 11732.
Merged to fixes in rev. 11733.
Michael.
More information about the fpc-devel
mailing list