Friday, February 22, 2013

GDI and USER Objects Dispose Closing Form

In windows application GDI and User Object  Exceeds limit if we dont remove the Objects after close form.

Solution:
During form close Collect GC and wait for till process complete will release the GDI and User Object if it is not disposed properly.

Code:
GC.Collect();GC.WaitForPendingFinalizers();

No comments :

Post a Comment