Working with C# in .NET, I am trying to call IActiveScript.Close on my instance of the Windows Scripting host.
Since I am currently hunting memory leaks, I discovered that I did not call this Close method and tried to add the missing code. So I added a call to the Closemethod.
Unfortunately, when calling the Close method, a COM exception is thrown with E_UNEXPECTED as the error code.
Querying the script state of the engine before closing it, it returns SCRIPTSTATE_CONNECTED.
Question:
How can I gracefully call IActiveScript.Close without getting an exception thrown?
To (partially) answer my own question:
I finally managed to build a stand-alone test application where I successfully can call the IActiveScript.Close method and also have no memory leaks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With