Search code examples
delphispring4d

Spring4d interface-based collection lifecycle


How do the interface-based collections in spring4d handle the lifecycle of their elements? What I would like to achieve is that when the collection gets out of scope, the containing objects are also freed, and their destructors called. Not sure this is the case at the moment.


Solution

  • The TCollections class offers a number of class methods to create new collections. These methods provide parameters that allow you to specify how the member lifetime is to be handled.