--- In [email protected], "brucexs" <bruc...@...> wrote:
> Can I suggest you implement some kind of global debugging services for any 
> object like
> obj.__refs__
> or some such which returns your internal ref count for the object.  Then 
> win.debug counts as your go through for loops. 

Good idea, will do.
 
> I suspect the release should do nothing if you implement reference counting.  
> Note that this is no release function for class-plugin objects and no 
> localcopy.  If you get an invalid handle, it should be a bug in your code or 
> mine.

I can imagine times when scripter would want to let go of a com resource before 
end of script.  I suppose could do that by

  myHandle = ""

if that reduces ref count to zero; that's how you do it in VB/VBS 
with

  set myHandle = Nothing

OTOH Removing release breaks existing code...

I can certainly recommend myHandle = "" as preferred way of releasing an object.

> >and I have to do the same anywhere I copy a handle
 
> If you are copying a handle, you should use changerefhandle both on the 
> assigned object and on any object which it is overwriting.  In that order; 
> see vec for sample and see the section on collection objects in the plugin 
> help.  Here I assume you are copying it to an com object.  If you are copying 
> using setvar to a plain variable, powerpro handles the calls to 
> changerefhandle.

Okay, ta.



Reply via email to