[PATCH resend 03/13] msscript.ocx: Add initial IScriptModule stub implementation.

Jacek Caban jacek at codeweavers.com
Fri May 29 11:52:05 CDT 2020

Hi Gabriel,

On 26.05.2020 14:41, Gabriel Ivăncescu wrote:
> Signed-off-by: Gabriel Ivăncescu<gabrielopcode at gmail.com>
> ---
> We have to treat a ref count of 0 in a special manner when they are linked
> to the script control, because the modules must exist even when they have
> no external refs (as the script control can still use them).
> However, as evidenced by the tests, they must*not*  keep a ref to the script
> control in this case, as it would create a circular ref and make no sense,
> anyway.
> The alternative solution to allocate separate data for modules would
> require copying the data to multiple places (one for Module Collection,
> and one for orphaned Modules) which is more complicated, in my opinion.

There must be a cleaner way. If you need too much special treatment for 
orphaned modules, it means that the design needs to be improved. One 
thing that is often useful for similar cases are weak reference: never 
reference control from module and make sure that control always 
invalidates the module->control pointer when it actually releases the 



More information about the wine-devel mailing list