mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
2b90e3a688
The deletion of a key in an observed object did clear the observers of that key but did not clear the atoms created (if any) when the key existed (e.g. on the key value if it was trackable). This can lead to a growing set of atoms that are useless but kept in memory if a lot of keys are added/deleted. The same thing can happen if a key value is changed many times and the values are trackable. Here we fix the problem by - keeping tracks of the objects that have been observed by an external call to the method "atom" (we call them seeds). - remove all observer atoms that are not seeds for observers of at least one key deletion or key value change. Note the fix is in some sense partial: a user could use the "atom" primitive making the new system uncapable of avoiding a leak (see test "atom on an object with a getter 3" where a getter is used in a weird way in an observed object).