Difference between revisions of "Introduction to Pluggy Arrays"

→‎Managing Arrays: Explained how to reuse the array
imported>Speedo
m (→‎Example: argh typos)
imported>Haama
(→‎Managing Arrays: Explained how to reuse the array)
Line 39: Line 39:


In order to avoid these problems, it's important that you:
In order to avoid these problems, it's important that you:
#Be ''very'' careful when overwriting an existing ArrayID.  Be ''sure'' that you've destroyed an array before overwriting its ArrayID - otherwise, you've got a memory leak.  If possible, you should simply reuse the existing array rather than destroying it and creating a new one.
#Be ''very'' careful when overwriting an existing ArrayID.  Be ''sure'' that you've destroyed an array before overwriting its ArrayID - otherwise, you've got a memory leak.  If possible, you can reuse the existing array (rather than destroying it and creating a new one) by setting its size to 0 with [[ArraySize]].
#Be ''sure'' that each use of [[CreateArray]] (or [[CopyArray]]) is matched with a use of [[DestroyArray]], except for the times when you specifically want an array to persist.
#Be ''sure'' that each use of [[CreateArray]] (or [[CopyArray]]) is matched with a use of [[DestroyArray]], except for the times when you specifically want an array to persist.


Anonymous user