maui
maui copied to clipboard
[controls] fix memory leak in `VisualElement.Clip`
This is very much related to 58a42e5. If you:
-
Define a
<RectangleGeometry />as aStaticResourceat the application-level. -
Use the
StaticResourceonVisualElement.Clip. -
The
VisualElementwill live forever.
I could reproduce this in a unit test.
I used the same technique in 58a42e5, except for one small change. The "proxy" member fields are now allowed to be null, so these small objects should only be created on-demand now. I added appropriate null checks for this as well.
I think the same Android API 30 keyboard-related tests are failing on main:
https://devdiv.visualstudio.com/DevDiv/_build/results?buildId=7446466&view=ms.vss-test-web.build-test-results-tab