[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: [PATCH v7 9/9] msscript.ocx: Implement the ScriptModule enumerator.
From:       Gabriel_Ivăncescu <gabrielopcode () gmail ! com>
Date:       2020-06-30 11:51:31
Message-ID: 8f34de29-6629-45c1-10f0-57afc15bb2d7 () gmail ! com
[Download RAW message or body]

Hi Jacek,

On 29/06/2020 19:01, Jacek Caban wrote:
> Hi Gabriel,
> 
> On 25.06.2020 16:59, Gabriel Ivăncescu wrote:
>> +struct module_enum {
>> +    IEnumVARIANT IEnumVARIANT_iface;
>> +    LONG ref;
>> +
>> +    UINT pos;
>> +    ScriptHost *host;
>> +    ScriptControl *control;
>> +};
> 
> 
> Do you need host reference if you already have control reference?
> 
> 
> Thanks,
> 
> Jacek
> 

Unfortunately yeah, because the enumerator becomes invalid when the host 
is detached. However, it still keeps the script control alive, and I 
have tests for both (the script control test is at the end of the test).

Please see the comment in the test `The enumerator is also invalid' for 
this behavior.

The way I do it right now is I compare the original host held by the 
enumerator to the control's host—if they don't match, it was detached.

I know it's not pretty, but I couldn't find a better way. If you have a 
better idea please let me know.

Thanks,
Gabriel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic