> 
> It's the vector handle. There are problems even if I take regex out 
of
> the picture.
> 
> http://tech.groups.yahoo.com/group/power-pro/message/30226
> 
> In 2006 message above, Bruce said vectors are automatically released
> when you recreate them with vec.create. 

What I meant was that vectors assigned to local variables are 
automatically released when you exit the script.

However, the two statements

local v= vec.create(109)
v = vec.create(10)

do _not_ cause the first vector sized 100  to be destroyed.  It is 
still there, wasting memory.  

Now you know why people like automatic gargage collection.  I debated 
implementing it (through reference counting) when I implemented 
objects and classes (which do have automatic garbage collection), but 
decided to leave well enough alone.

You have to free all vectors before re-assigning to a variable which 
still could have a vector assigned to it.



But that is not happening
> inside a for loop, and attempt to destroy was incorrect.
> 
> Even when my destroy syntax is corrected (and local variable ov has 
to
> be declared before testing "if (vec.exists(ov))" ) there may be
> problems. In my real script I started seeing an error:
> 
> Out of memory  in processing for each


There is a limit to how deeply you can nest for each, I think 4 or 
so, and then includes in script calls.  I suspect you ran into the 
above because of the other errors in the for statement, which 
possibly meant the for each memory was not properly cleaned up.

Reply via email to