Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Deleting / Unsetting Hierachical Objects / Faces

From: james::mustard::co::nz at: 20-Dec-2001 0:54

Hi All, At present I am working on a bit of code that encapsulates over 300 faces into a single context. Unfortunately since these faces are all ordered in an object-like manner and some have timers involved, doing a mass delete of the object is not always giving expected results and memory is not being released until the script ends - this gets to be an issue once the 65MB object is re-loaded a few times... (Am expecting on average about 1000 - 2000 reloads of the object as it is part of a game interface, also the test scripts and associated files are over 5MB compressed so they wont be sent anywhere in a hurry ;-) ) First I defined an object called desktop that is simply a screen-wide face (yes - i know this overrides the internal desktop command in view). To desktop/pane I append the my-object/my-top-face (which by default includes all its subfaces and animations). Then to test memory release I added a button to desktop (see below) to release my-top-face from the desktop and kill my-object like so: => button "Remove Object" [remove find desktop/pane my-object/my-top-face my-object: copy []] ;I also tried unset 'my-object in the remove button - but this did not affect sub-faces and timers Next I added a button to call in the %my-context-object.r file which creates the my-object and appends its my-object/my-top-face to the desktop. => button "Add Object" [do %my-context-object.r show desktop] (code from %my-context-object.r is merely an append desktop/pane my-top-face) What I need to know is: 1) How do I properly delete huge multi-level objects (please don't say property by property...) 2) How do I make sure that all memory is reclaimed (ie trigger garbage collection manually) - provided this is not already covered by step 1. Thanks :) James.