<div dir="ltr">Hi Huw,<div class="gmail_extra">2014-06-26 15:54 GMT+08:00 Huw Davies <<a href="mailto:huw@codeweavers.com" target="_blank">huw@codeweavers.com</a>>:<br>
><br>><br>> I'm sure you can think about how to simplify this a bit.<br>> The clue that it needs simplification is that you've<br>> got two AddRef()s in there.<br>><br>> Hint: The code is trying to do two things:<br>



><br>> 1. If needed, assign an interface to reOle<br>> 2. AddRef and return.<br>></div><div class="gmail_extra">> > --- a/dlls/riched20/richole.c<br>> > +++ b/dlls/riched20/richole.c<br>> > @@ -126,12 +126,13 @@ IRichEditOle_fnRelease(IRichEditOle *me)<br>



> ><br>> >      TRACE ("%p ref=%u\n", This, ref);<br>> ><br>> > -    if (!ref)<br>> > +    if (ref == 1)<br>> >      {<br>> >          TRACE ("Destroying %p\n", This);<br>



> >          This->txtSel->reOle = NULL;<br>> >          ITextSelection_Release(&This->txtSel->ITextSelection_iface);<br>> >          IOleClientSite_Release(&This->clientSite->IOleClientSite_iface);<br>



> > +        This->editor->reOle = NULL;<br>><br>> No, this is wrong.  This function should remain unchanged.<br>><br>> The editor is in charge of the reOle reference, so it<br>> needs to release it when the editor is destroyed -<br>



> ie in ME_DestroyEditor().<br>></div><div class="gmail_extra"><br></div><div class="gmail_extra">I will try again.<br></div><div class="gmail_extra"><div class="gmail_extra">Thanks for your review.  :)</div><div>
<br></div></div><div class="gmail_extra"><br>-- <br><div dir="ltr">
<div>Regards,<br></div><div>Jactry Zeng</div><div><br></div></div>
</div></div>