> It pulls up this PowerPro error box:
> Invalid vector number: v2
> 
> If, however, I change the above line to an assignment:
> AliasVector = Vec.Destroy(AliasVector)
> 
> then there is no error. There is no practical reason to reset the


I know there is a long thread on this, but IMHO, the best solution 
is the one in the original note, which is to always use the idiom 
you should above when destroying a vector.  It makes sure you do not 
have a "dangling pointer", that is a pointer (or handle) stored in a 
variable which does not name a value data structure any more.

I understand it is not strictly needed in your case, since you are 
sure that the variable AliasVector will not be used later, but I 
still think its good style to always use the above idiom.

If you do not reset the variable, as you point out, when PowerPro 
frees the local variable AliasVector it sees that it points to a 
vector and assumes that vector too is local and must be destroyed.  
One could argue that the should be no error message.  But the 
advantage of the error message is that it reminds you that you 
created a dangling pointer, which could have led to other problems.









------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/JV_rlB/TM
--------------------------------------------------------------------~-> 

Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to