--- In [email protected], "brucexs" <bruc...@...> wrote:
>
> 
> > Pouf, g_obj2 is a dead dodo, and next time someone tries to use it, it's an 
> > error.

> Another point to consider here:  it is true that it is easy for you to detect 
> an error here, but it may be hard for the scripter to determine the root 
> cause of the error:  if the continue to use a mix of ref counting and 
> explicit releases, then it may be hard to determine where the dangling 
> reference was created.

True.  Okay, you've convinced me.  release will be in (so as not to break 
existing but strongly deprecated.  As "I ABJURE thee if thoust useth realeasth"

Meanewhile, got a problem, using ref counting, using PowerPro 4.9.1.8
PowerPro 4.9m7  21/03/2010.

using a subset of
comPluginDemoScriptFileSysObjDotSyntaxForEach.powerpro
from com distro, modified to remove release calls and such.

objFSO = com.create_object("Scripting.FileSystemObject") 
; objFSO displays as "c\x05 0000"

local objFolder = objFSO.GetFolder(scriptfolder)
; objFolder displays as "cx05 0001"

win.debug("Here's a list of files in " ++ scriptfolder ++ ":")
for each objFile  in objFolder.Files
; objFile (handle) displays as "c\x05 0003" 
;(for each objFile) first time into script
; "c\x05 0004" (for each objFile) next time into script, etc

  win.debug("handle: " ++ objFile ++ " ref cnt: " ;;+
   ++ objFile._refs__ ++  ",name: " ++ objFile.Name) 
endfor

quit

'same thing happens this way
local hCollectionFiles = objFolder.Files
for each objFile  in hCollectionFiles
  win.debug(" com handle: " ++ objFile ++ " ref cnt: " ;;+
   ++ objFile._refs__ ++  ", name: " ++ objFile.Name) 
endfor

;note enumerator generated from objFolder.Files begins "e\x05 " and ;is 
correctly released in forEach callback code (checked in debugger).

Looks like maybe last handle obtained by enumerator (stored in objFile) the 
last time through for each loop isn't getting released.  Could be my code?  










Reply via email to