How to dispose BO stored at field?


Author
Message
ChanKK
ChanKK
StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)StrataFrame User (248 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
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
Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search