Skip to content

Commit 3a24093

Browse files
committed
In JavaScriptEngineSwitcher.ChakraCore fixed a error #34 “Finalazier thread is blocked because of JavaScriptEngineSwitcher.ChakraCore.ChakraCoreJsEngine”
1 parent 083e81d commit 3a24093

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

Diff for: src/JavaScriptEngineSwitcher.ChakraCore/ChakraCoreJsEngine.cs

+8-9
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public sealed class ChakraCoreJsEngine : JsEngineBase
9393
/// <summary>
9494
/// Script dispatcher
9595
/// </summary>
96-
private readonly ScriptDispatcher _dispatcher;
96+
private ScriptDispatcher _dispatcher;
9797

9898
/// <summary>
9999
/// Unique document name manager
@@ -1689,16 +1689,15 @@ private void Dispose(bool disposing)
16891689
{
16901690
if (_dispatcher != null)
16911691
{
1692-
_dispatcher.Invoke(() =>
1693-
{
1694-
if (_jsContext.IsValid)
1695-
{
1696-
_jsContext.Release();
1697-
}
1698-
_jsRuntime.Dispose();
1699-
});
17001692
_dispatcher.Dispose();
1693+
_dispatcher = null;
1694+
}
1695+
1696+
if (_jsContext.IsValid)
1697+
{
1698+
_jsContext.Release();
17011699
}
1700+
_jsRuntime.Dispose();
17021701

17031702
if (disposing)
17041703
{

Diff for: src/JavaScriptEngineSwitcher.ChakraCore/JavaScriptEngineSwitcher.ChakraCore.csproj

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ This package does not contain the native implementations of ChakraCore. Therefor
2323
<PackageIconUrl>https://raw.githubusercontent.com/Taritsyn/JavaScriptEngineSwitcher/master/Icons/JavaScriptEngineSwitcher_ChakraCore_Logo128x128.png</PackageIconUrl>
2424
<PackageTags>JavaScriptEngineSwitcher;JavaScript;ECMAScript;ChakraCore</PackageTags>
2525
<PackageReleaseNotes>1. Added support of .NET Framework 4.7.1;
26-
2. Fixed a implementation of the `JsSerializedLoadScriptCallback` delegate.</PackageReleaseNotes>
26+
2. Fixed a implementation of the `JsSerializedLoadScriptCallback` delegate;
27+
3. Fixed a error #34 “Finalazier thread is blocked because of JavaScriptEngineSwitcher.ChakraCore.ChakraCoreJsEngine”.</PackageReleaseNotes>
2728
</PropertyGroup>
2829

2930
<Import Project="../../build/common.props" />

Diff for: src/JavaScriptEngineSwitcher.ChakraCore/readme.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
RELEASE NOTES
3232
=============
3333
1. Added support of .NET Framework 4.7.1;
34-
2. Fixed a implementation of the `JsSerializedLoadScriptCallback` delegate.
34+
2. Fixed a implementation of the `JsSerializedLoadScriptCallback` delegate;
35+
3. Fixed a error #34 “Finalazier thread is blocked because of
36+
JavaScriptEngineSwitcher.ChakraCore.ChakraCoreJsEngine”.
3537

3638
=============
3739
DOCUMENTATION

0 commit comments

Comments
 (0)