--- In [email protected], "entropyreduction"
<alancampbelllists+ya...@...> wrote:
zeroing ref count for locals (that should go out of scope and die anyway)
doesn;t make problem go away:
local objFile
local hCollectionFiles = objFolder.Files
for each objFile in hCollectionFiles
win.debug(" com handle: " ++ objFile ++ " ref cnt: " ++ objFile._refs__ ++
", name: " ++ objFile.Name)
endfor
objFile = ""
hCollectionFiles = ""
>
> --- In [email protected], "brucexs" <brucexs@> wrote:
> 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?
>