-
-
Notifications
You must be signed in to change notification settings - Fork 672
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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]>
- Loading branch information
1 parent
786e24f
commit 6f6ba0f
Showing
2 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters