Re: Memory access violation using pywin32 as WSH

Mark Hammond <[email protected]> Wed, 30 Nov 2022 10:23:11 +1100
Newsgroups gmane.comp.python.windows
Message-ID <[email protected]>
On 30/11/2022 9:09 am, Bob Kline wrote:
>
> So at least part of that puzzle is cleared up, though it's still 
> somewhat unsettling that only seven calls to ScriptItem.Close() are 
> made, regardless of how many ScriptItem objects have been instantiated 
> during a session.


The close method is 
https://learn.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.debugger.interop.iactivescript.close?view=visualstudiosdk-2019, 
so it's the responsibility of the host to call that. I agree it's a bit 
of a red flag, and may point to confusion in the host about object 
lifetimes, which could certainly end up causing what you are seeing. 
It's worth pointing out that any "obvious" bug in pywin32 here would 
probably be able to be reproduced in, and reported by, the various other 
hosts, including cscript.exe and wscript.exe (which themselves are just 
active script hosts, just like your problematic host)

Mark

_______________________________________________
python-win32 mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-win32