You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatic unregistering of BindableProperty objects (#4122)
First draft to fix the issue reported in #4109.
Replaces the values in the `binding.bindable_properties` data structure,
which acts as a "registry" for available bindable properties, with
`weakref.finalize` objects. Previously, there was a permanent reference
to the owner of the `BindableProperty`, which was never cleared unless
explicitly removed with `binding.remove`.
I also added some very basic tests for this behavior. You may need to
refactor these slightly.
*What I did not test, and what in theory should still be a problem, is
when 2 models have bindable properties and one model binds to a value of
the other. Then permanent references to the models are kept in
`binding.bindings`, which are never automatically cleaned up.*
---------
Co-authored-by: Andreas Bayer <[email protected]>
Co-authored-by: Falko Schindler <[email protected]>
0 commit comments