microsoft / WindowsAppSDK-Samples

Feature samples for the Windows App SDK
MIT License
721 stars 225 forks source link

Add proper island cleanup flow to DrawingIsland sample app #344

Closed adpa-ms closed 5 months ago

adpa-ms commented 5 months ago

Since the DrawingIsland is stored in the ContentIsland's AppData, we must ensure that the ContentIsland is Closed in order to break the memory reference cycle. While in this particular case we could rely on the ContentIsland being closed implicitly when the window is torn down, I think it is better practice to explicitly call Close() during the Window.Closing event.