http://rpg.hamsterrepublic.com/bugzilla/show_bug.cgi?id=754
Ralph Versteegen <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|FIXED | --- Comment #9 from Ralph Versteegen <[email protected]> 2009-10-16 02:36:42 PDT --- (In reply to comment #6) > Okay, I figured out what is going on here. It is actually pretty simple, and I > am embarrassed I didn't notice it sooner. > > plotscript, trigger bug 754, begin > variable(parent, child) > parent := create container(100, 100) > child := load hero sprite(0) > set parent(child, parent) > free slice(parent) > set hero x(child, 0) > end > > Now the *expected* behavior here is that the "set hero x" at the end of this > script should fail gracefully. "child" still has the handle it got from "load > hero sprite", but the slot in the plotsprites() array that is indexed by that > handle did not get zeroed when we deleted the parent. > > So how do we solve this? The ENABLE_SLICE_DEBUG hack I just added solves the > problem by brute force, but is there a better way? Simple. Add a member in the slice type which gives the plotslices() handle if it exists. (It will then become trivial to make sure only one such handle exists.) Eventually this member will instead point to the entry in the table used by the interpreter to hold object references (including slice handles) which will replace the plotslices() array. Incidentally, these tables could also be used directly by FB code wanting to keep track of something in the way that the SliceDebug() array does, as well as scripts. For example, Mike wrote "Implement NodeList" in the RELOAD implementation plan, but a much better idea is to write the script arrays backend code and return the results of an RPath query in a script array, even if it was called by some FB code instead of a script. -- Configure bugmail: http://rpg.hamsterrepublic.com/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. _______________________________________________ Ohrrpgce mailing list [email protected] http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
