StrataFrame Forum

How to dispose BO stored at field?

http://forum.strataframe.net/Topic22969.aspx

By ChanKK - 4/30/2009

Hi,

I have initialized a BO to MasterPage's private field.



private MyBO _myBO = new MyBO();




How could I dispose it? I tried to override MasterPage.Dispose() and call BO.Dispose(). However, it is not been released. I check using ANT profiler, it still show the BO is still at memory.



Any ideas?



Thank you
By Trent L. Taylor - 4/30/2009

Did you actually trace to see that the BO gets disposed in the masterpage dispoal?  That would be the first thing that I would do.  The only other reason that it would not dispose is there is another class that has a reference to the object...or an event handler.  If you are adding a handler to the BO and not removing the handler then you can have an object stick around as well.