Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disconnect from host events on engine dispose #183

Closed
uranoxyd opened this issue May 14, 2020 · 5 comments
Closed

Disconnect from host events on engine dispose #183

uranoxyd opened this issue May 14, 2020 · 5 comments

Comments

@uranoxyd
Copy link

I facing some issues when using host events from script code.
If i dispose the engine object/script, all event handlers from the script stay attached to the host events. So when the host event gets invoked a ObjectDisposedException occurs.

I know that i could disconnect the events script-side before disposing the engine, but i would like to see the engine cleaning up after itself though :).

Am i missing something and there is a way to do this? If not, i would suggest this as a feature request/improvement.

@ClearScriptLib
Copy link
Collaborator

Hi @uranoxyd,

Are you referring to event connections established via EventSource<T>.connect?

Thanks!

@uranoxyd
Copy link
Author

I think yes, i mean host events handled in script, like mentioned in the FAQtorial (16) hostEvent.connect(handler)

@ClearScriptLib
Copy link
Collaborator

Thanks @uranoxyd. We believe this is a worthwhile enhancement and will implement it in the next ClearScript release.

@uranoxyd
Copy link
Author

Thanks, glad to hear

ClearScriptLib added a commit that referenced this issue May 29, 2020
…; added JavaScriptExtensions.ToTask (GitHub Issue #182); added DocumentLoader.MaxCacheSize and DocumentCategory.MaxCacheSize; added code to break event connections on engine disposal (GitHub Issue #183); improved ES6 module support, fixing cycle crash (GitHub Issue #181); added DynamicHostObject (GitHub Issue #180); added BigInt / BigInteger support for V8 (GitHub Issue #176); hardened Assembly.Load call in V8Proxy.cs (GitHub Issue #175); improved V8Update environment isolation to fix some V8 build issues (GitHub Issue #185); updated API documentation. Tested with V8 8.3.110.9.
@ClearScriptLib
Copy link
Collaborator

Fixed in Version 6.0.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants