<div dir="ltr"><div class="gmail_extra">Hi Huw,<br>2014-09-11 19:55 GMT+08:00 Huw Davies <<a href="mailto:huw@codeweavers.com" target="_blank">huw@codeweavers.com</a>>:<br>><br>><br>> This looks very suspicious to me.  You're storing a reference to<br>> 'reOle' so you should AddRef it somewhere.  It may be better to pass<br>> the interface ptr, AddRef and store that.<br>><br>> Also, is the purpose of rangelist just to be able to NULL out reOle<br>> when the parent object is destroyed?  If so, this can go away if you<br>> correctly handle the ref counting.<br><br>Thanks for your review!</div><div class="gmail_extra"><br></div><div class="gmail_extra">I have tested ref count of reOle/txtDoc in Windows, and ref count</div><div class="gmail_extra">of reOle/txtDoc didn't increase after ITextDocument::Range. So I didn't</div><div class="gmail_extra">call AddRef in ITextDocument::Range.</div><div class="gmail_extra"><br><div class="gmail_extra">  create_interfaces(&w, &reOle, &txtDoc, NULL);</div><div class="gmail_extra">  refcount = get_refcount((IUnknown *)txtDoc);</div><div class="gmail_extra">  ok(refcount == 3, "got wrong ref count: %d\n", refcount);</div><div class="gmail_extra">  hres = ITextDocument_Range(txtDoc, 0, 0, &txtRge);</div><div class="gmail_extra">  ok(hres == S_OK, "ITextDocument_Range fails 0x%x.\n", hres);</div><div class="gmail_extra">  refcount = get_refcount((IUnknown *)txtRge);</div><div class="gmail_extra">  ok(refcount == 1, "get wrong refcount: returned %d expected 1\n", refcount);</div><div class="gmail_extra">  refcount = get_refcount((IUnknown *)txtDoc);</div><div class="gmail_extra">  ok(refcount == 3, "got wrong ref count: %d\n", refcount);</div><div><br></div><div><br></div>-- <br><div dir="ltr"><div>Regards,<br></div><div>Jactry Zeng</div><div><br></div></div>
</div></div>