[PATCH v2 2/8] vbscript: Store non-persistent code into the script dispatch object.

Gabriel Ivăncescu gabrielopcode at gmail.com
Wed Oct 30 09:35:44 CDT 2019


On 10/30/19 4:21 PM, Jacek Caban wrote:
> On 10/30/19 1:57 PM, Gabriel Ivăncescu wrote:
>> diff --git a/dlls/vbscript/vbscript.c b/dlls/vbscript/vbscript.c
>> index cff2ef5..a968f8d 100644
>> --- a/dlls/vbscript/vbscript.c
>> +++ b/dlls/vbscript/vbscript.c
>> @@ -94,6 +94,10 @@ static void exec_queued_code(script_ctx_t *ctx)
>>           if(iter->pending_exec)
>>               exec_global_code(ctx, iter, NULL);
>>       }
>> +    LIST_FOR_EACH_ENTRY(iter, &ctx->script_obj->code_list, vbscode_t, 
>> entry) {
>> +        if(iter->pending_exec)
>> +            exec_global_code(ctx, iter, NULL);
>> +    }
>>   }
> 
> 
> I'm not sure we want two different lists for those. Why can't we simply 
> store the flag inside vbscode_t?
> 
> 
> Jacek
> 

Well one of them is supposed to live on with the script dispatch and get 
destroyed with it. It's more correct to have two lists in this case.

For example, we'd still have to traverse this list and free only those 
with the 'flag' set when we release the script dispatch, skipping the 
others, so we'll still need an extra loop like this. But it won't work 
correctly if the app holds a ref to the script dispatch. Since it will 
now lose access to the code the dispatch references.

Not sure if it matters much in practice (will probably matter with named 
contexts implementation later).



More information about the wine-devel mailing list