> There seems to be an unreleased handle left over after
>
> With objRange.Font
>
> .Bold = 1
> .Animation = 3
> .Size = 30
>
> endWith
The above is implemented as
local _with_1 = objRange.Font
_with_1.bold = 1 //etc
_with_1 = "" // should decrement ref count to objRange.Font
So maybe the problem you are experiencing is related to following. But if you
try the above statements explicitly, and they are the only statements in the
script (or at least the script is as small as possible), does it work?
>
> objDoc = objApp.Documents.Add
> ...
> local objDoc = com.get_object(scriptfolder ++ ?"\demo.doc")
>
> results in an unreleased handle, but
>
> objDoc = objApp.Documents.Add
> ...
> objDoc = com.get_object(scriptfolder ++ ?"\demo.doc")
>
> releases handle as expected
I cannot duplicate the above situation with my ref counted vectors. The
following seems to be the same structure as what you are doing, but it works:
local vv, qq
vv= vec.create(10)
win.debug("should be 1", vv.__refs__)
qq=vv
win.debug("a. should be 2", vv.__refs__)
win.debug("b. should be 2", qq.__refs__)
local vv=vec.create(12)
win.debug("c. should be 1",vv.__refs__)
win.debug("d. should be 1",qq.__refs__)
local qq=vv
win.debug("e. should be 2",vv.__refs__)
win.debug("ee. should be 2",qq.__refs__)
local vv=vec.create(12)
win.debug("f. should be 1", vv.__refs__)
win.debug("g. should be 1",qq.__refs__)
local xx=qq
win.debug("h. should be 2",xx.__refs__)
local qq=""
win.debug("i. should be 1",xx.__refs__)
Can you send me a whole script that fails, including _refs__ debug output?
>