[PATCH v2 02/10] vbscript: Reference count the persistent code list.

Jacek Caban jacek at codeweavers.com
Wed Nov 13 15:53:00 CST 2019

Hi Gabriel,

On 11/13/19 4:24 PM, Gabriel Ivăncescu wrote:
> Signed-off-by: Gabriel Ivăncescu<gabrielopcode at gmail.com>
> ---
> This is needed for the TypeInfo since it needs to hold a ref to the
> persistent code, too. Though we keep the ref in the script dispatch since
> it's more correct this way (even though we bail out when there's no context,
> we still technically reference the persistent code funcs/classes in the
> dispatch object).
> I couldn't refcount the script context itself since it is re-used after being
> closed, and was not deemed a good approach to free it (my previous attempts).

It doesn't look pretty, but also I think it's not enough for what you 
need. What about non-persistent code? Unless I'm missing something, this 
will be exposed from ITypeInfo as well, but freed when script is 
uninitialized, so we will crash on an attempt to access it. An 
alternative idea would be to add a reference count to vbscode_t itself. 
It could be referenced by each entry in global variables and functions 
arrays as well as from ITypeInfo implementation. How does that sound?



More information about the wine-devel mailing list