My theory is that the BBS is somehow dynamically creating columns in the grid or tree at runtime, but not manually disposing of them when it's unloaded. DevExpress basically expects you to dispose of everything, so I'm wondering if somehow the BBS is still linked to the DevExpress controls and preventing them from being released from memory correctly. Is this a possibility?
I can open and close a test form I have created without filling the BO that is linked to the BBS, and it releases all memory correctly when the form is closed. If I fill the BO when opening the form, it will not release all memory once closed. Any ideas here?
<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
In this particular example, I rarely manually dispose of the object. And we have this type of code all over the place. We have hundreds of instances where we have this type of code and it gets cleaned up. When I was referring to in code, I was talking about as a local like this:
'-- Do your stuff here
lc.Dispose()
However, it never hurts to manually Dispose() of objects if they are getting "hung up" due to the environment in which they are being used. So in your case, I would manually Dispose() to see if memory gets cleaned up. In this case, I would palce all of my logic in the BaseBO in which all of my BOs inherit. Then this code would be implemented in a single location versus having to be re-written for each BO. Also, using this approach will not be an issue with the partial class.