winforms icon indicating copy to clipboard operation
winforms copied to clipboard

MonthCalendar accessible objects are leaking in memory

Open Olina-Zhang opened this issue 2 years ago • 1 comments

.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: image

Steps to reproduce

  1. 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.
  2. Press the second button to open the child form with MonthCalendar.
  3. Start the Accessibility Insights tools.
  4. Run automated checks for the MonthCalendar control using Narrator.
  5. Close the child form.
  6. Clear memory with the first button of the parent form.
  7. DON'T close Narrator.
  8. Look for MonthCalendar accessible objects left in memory (using WinDbg, or dotMemory, or another suitable tool).

Tested sample application: WinFormsApp5_MonthCalendar.zip

Olina-Zhang avatar Sep 01 '22 10:09 Olina-Zhang

@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.

merriemcgaw avatar Sep 07 '22 00:09 merriemcgaw

Re-tested this issue on Win10 and Win11 as following steps, found it just repro on Win10.

Repro steps:

  1. Launch test project in .Net 8.0
  2. Launch Windbg and attach this test app
  3. Open Narrator, and click Go button in Windbg
  4. Focus on test app, click OpenMonthCalendar button to open another form with MonthCalendar
  5. Focus on MonthCalendar, click some specific dates, then click Previous, Next buttons more times
  6. Click year button, then click today button, click date to specific day
  7. Click Previous Button
  8. Close Form with monthCalendar
  9. Click GC.Collect button more times to 0
  10. In Windbg to input following to check if there has some AO memory leak:
.reload
!DumpHeap -type MonthCalendar

Result on Win10: image

Result on Win11: image or image

Olina-Zhang avatar Nov 02 '22 08:11 Olina-Zhang

@Tanya-Solyanik should we try to fix that on our side if it depends on OS?

NikitaSemenovAkvelon avatar Nov 02 '22 08:11 NikitaSemenovAkvelon

@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!

Tanya-Solyanik avatar Nov 02 '22 19:11 Tanya-Solyanik