NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 15 16 17 18 19 … 93 Next »
I'm in-disposed

 
  • 0 Vote(s) - 0 Average
I'm in-disposed
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,677
Threads: 767
Joined: Nov 2003
#11
2011-05-17, 04:42 AM
sub Wrote:You probably wouldnt need to do that. Calling uiList.Dispose() and .Dispose() on any other UiXXXX controls, should take care of it.

ie, you're probably not creating these lower level UiElement objects yourself, but instead having them returned from the uiList's cache etc.
Actually, thats the theory, but I just double checked and found I wasnt cleaning up properly in the UiList class. I've fixed it for the next release. You'd probably only have noticed any problem if you were creating and recreating lists (which the built in screens dont do).
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,894
Threads: 955
Joined: May 2006
#12
2011-05-17, 05:12 AM
Ok thanks sub. It was kind of fun viewing everything backward but I look forward to this. I do have an new question

I run "PopulateList()" functions on UiLists[5] when needed and I switch around with

base.uiList = uiList[activeList];

at the exit is is safe for me to Dispose() of my base.uiList or should I leave it for NPVR and Dispose of the others?

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,677
Threads: 767
Joined: Nov 2003
#13
2011-05-17, 05:46 AM
mvallevand Wrote:at the exit is is safe for me to Dispose() of my base.uiList or should I leave it for NPVR and Dispose of the others?
It shouldnt matter if you call Dispose() and the base class does it too (in Base.Dispose()).
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,894
Threads: 955
Joined: May 2006
#14
2011-05-17, 11:13 PM
sub Wrote:There is a couple of different types of resources to be aware of.

1) Large .NET objects like Bitmap etc. These consume a lot of memory. They're typically garbage collected automatically when no longer referenced by anything, but because they're large its nice to Dispose() of them if you know they're no longer in use.

2) Unmanaged objects, like the direct3d texture memory used by UIElement objects. These are not garbage collected, and need to be manually Dispose()'d of to force the texture memory to be released to the videocard. If you're manually creating UIElement objects, then call Dispose() on them if you no longer need them. If you're using higher level controls like UIStatic etc, calling Dispose() on these controls will automatically call Dispose() on the UIElement object's it owns.

Thanks again, but I guess I am still learning. I don't know a lot about .NET or garbage collection but if I add a user defined class into the Hashtable, and that class includes an Image, are you seeing you will call .Dispose on the object if I defined, or should I do this in the destructor?

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,677
Threads: 767
Joined: Nov 2003
#15
2011-05-17, 11:29 PM
mvallevand Wrote:I don't know a lot about .NET or garbage collection but if I add a user defined class into the Hashtable, and that class includes an Image, are you seeing you will call .Dispose on the object if I defined, or should I do this in the destructor?
No. I have no idea where your images have come from, or whether you have other references to them in your cache classes etc. The UIStatic etc Dispose() methods will only clean up the bitmaps they've created internally (and the related Direct3D textures if used on a PC).
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): « Previous 1 2


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode