Skip to content

Improved reference counting in constructor/store

Choose a tag to compare

@bmomberger-bitovi bmomberger-bitovi released this 09 Feb 17:29
· 255 commits to master since this release

The constructor/store behavior holds on to lists and instances that are retrieved in a connection and later bound to events or listened on. If these lists are retrieved again from a data provider, Map instances are reused when hydrating the data into constructor instances. This ensures that updates from data providers cause updates to relevant data across the application.

Previously, membership in a list in the list store wasn't incrementing references to instances in the instance store, causing instances to be dropped from the store when they weren't directly observed while still being held onto as members of stored lists. This created undesirable multiple copies of some instances.

Now membership in a stored list adds references to instances, causing them to be stored in the instance store as long as they also exist (indirectly through list membership) in the list store.