winforms
winforms copied to clipboard
MonthCalendar accessible objects are leaking in memory
.NET version
8.0.100-alpha.1.22430.2
Did it work in .NET Framework?
No
Did it work in any of the earlier releases of .NET Core or .NET 5+?
No
Issue description
MonthCalendar accessible objects are left in memory after the MonthCalendar control instance was inspected with accessibility tool: just Narrator and the form with MonthCalendar is closed, garbage is collected, but Narrator is still opened.
Report from WinDbg:
Steps to reproduce
- Create a parent form with two buttons: one will be opening a child form with the MonthCalendar control and the other will collect the garbage.
- Press the second button to open the child form with MonthCalendar.
- Start the Accessibility Insights tools.
- Run automated checks for the MonthCalendar control using Narrator.
- Close the child form.
- Clear memory with the first button of the parent form.
- DON'T close Narrator.
- Look for MonthCalendar accessible objects left in memory (using WinDbg, or dotMemory, or another suitable tool).
Tested sample application: WinFormsApp5_MonthCalendar.zip
@vladimir-krestov / @dmitrii-drobotov can you assign this to the appropriate person on your team? Not an urgent issue but one good to fix as much as possible.
Re-tested this issue on Win10 and Win11 as following steps, found it just repro on Win10.
Repro steps:
- Launch test project in .Net 8.0
- Launch Windbg and attach this test app
- Open Narrator, and click Go button in Windbg
- Focus on test app, click OpenMonthCalendar button to open another form with MonthCalendar
- Focus on MonthCalendar, click some specific dates, then click Previous, Next buttons more times
- Click year button, then click today button, click date to specific day
- Click Previous Button
- Close Form with monthCalendar
- Click GC.Collect button more times to 0
- In Windbg to input following to check if there has some AO memory leak:
.reload
!DumpHeap -type MonthCalendar
Result on Win10:
Result on Win11:
or
@Tanya-Solyanik should we try to fix that on our side if it depends on OS?
@Tanya-Solyanik should we try to fix that on our side if it depends on OS?
no, I'll close this bug. @Olina-Zhang - thank you for the verification!