I'm getting this weird behavior when disposing a V8Engine object instance.
System.ObjectDisposedException: Safe handle has been closed
at System.Runtime.InteropServices.SafeHandle.DangerousAddRef(Boolean& success)
at System.StubHelpers.StubHelpers.SafeHandleAddRef(SafeHandle pHandle, Boolean& success)
at Microsoft.Win32.Win32Native.SetEvent(SafeWaitHandle handle)
at V8.Net.ObservableWeakReference`1.DoFinalize(T obj)
This is how I'm disposing the engine instance:
public void Dispose()
engine = null;
Since this occurs on the Finalizer thread, this crashes my application completely and there's no way of handing the exception. Am I doing something wrong? Is there a special way of disposing the V8Engine?
I'm using the latest release of V8.NET on a 64bit machine.
Thank you :)