SkipFire
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2012
09:52 AM
Cleaning Orphaned Objects
Is there a way to get a list of what the orphaned objects are on exit? As a professional developer I'm getting a little annoyed by the GC message and I'm sure it doesn't hurt much of anything and that they get cleaned up anyway, but if I know what those are maybe I can track them down and clean them up sooner just to make my code better and maybe even perform better.
Also, I am guessing that a few of them are things in global m, is there a way to clear that?
Thanks.
Also, I am guessing that a few of them are things in global m, is there a way to clear that?
Thanks.
2 REPLIES 2

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2012
10:32 AM
Re: Cleaning Orphaned Objects
print RunGarbageCollector()

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2012
12:06 PM
Re: Cleaning Orphaned Objects
"RokuJoel" wrote:print RunGarbageCollector()
I believe that will only return the count of orphaned objects, not what they are.
@SkipFire, in my experience, any time you exit the channel with the home button, you're going to have orphaned objects, because the screen stack doesn't have an opportunity to close cleanly. There is a second or two before complete termination as the box closes the screens where some cleanup could be executed to clear any content lists you have referenced, but it's hit or miss (particularly if you have an roAudioPlayer instance open). As for clearing the global m, any function not called within the context of an object/associative array has access to the global m, so you could just create a standalone function to do that cleanup.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)