Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
205 views
in Technique[技术] by (71.8m points)

c# - WinForms ToolStripComboBox Leaks Memory (Font & Region)

Create one form (Set as a startup form) having ToolStrip with ToolStripButton and ToolStripComboBox. On the button, click open an instance of this form and close the new instance. Observe the GDI Objects before opening the form and after Opening & Closing the form. Looks like a bug but how to deal with it?

Task Manager & GDIView can be used to observe the results.

Edit When we open the form Font count goes up by 7 and on close, the count goes down by 6. 1 is left and never collected. Event If I invoke GC.Collect() with forced parameters or wait for serval minutes that one Font object is never collected. If my application is running for hours and different editors (Forms) having toolbar are opened then closed it keeps growing.

question from:https://stackoverflow.com/questions/65838945/winforms-toolstripcombobox-leaks-memory-font-region

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...