Skip to content

Commit 80705f3

Browse files
committed
In JavaScriptEngineSwitcher.ChakraCore an attempt was made to prevent occurrence of the access violation exception
1 parent 4191938 commit 80705f3

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

NuGet/JavaScriptEngineSwitcher.ChakraCore/JavaScriptEngineSwitcher.ChakraCore.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This package does not contain the native implementations of ChakraCore. Therefor
2020
* JavaScriptEngineSwitcher.ChakraCore.Native.debian-x64
2121
* JavaScriptEngineSwitcher.ChakraCore.Native.osx-x64</description>
2222
<summary>JavaScriptEngineSwitcher.ChakraCore contains adapter `ChakraCoreJsEngine` (wrapper for the ChakraCore).</summary>
23-
<releaseNotes>ChakraCore was updated to version 1.5.0.</releaseNotes>
23+
<releaseNotes>An attempt was made to prevent occurrence of the access violation exception.</releaseNotes>
2424
<copyright>Copyright (c) 2013-2017 Andrey Taritsyn - http://www.taritsyn.ru</copyright>
2525
<language>en-US</language>
2626
<tags>JavaScriptEngineSwitcher JavaScript ECMAScript ChakraCore</tags>

NuGet/JavaScriptEngineSwitcher.ChakraCore/readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
=============
3131
RELEASE NOTES
3232
=============
33-
ChakraCore was updated to version 1.5.0.
33+
An attempt was made to prevent occurrence of the access violation exception.
3434

3535
=============
3636
DOCUMENTATION

src/JavaScriptEngineSwitcher.ChakraCore/ChakraCoreJsEngine.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ public ChakraCoreJsEngine(ChakraCoreSettings settings)
160160
{
161161
_jsRuntime = JsRuntime.Create(attributes, null);
162162
_jsContext = _jsRuntime.CreateContext();
163+
_jsContext.AddRef();
163164
}
164165
catch (Exception e)
165166
{
@@ -1178,7 +1179,11 @@ private void Dispose(bool disposing)
11781179
{
11791180
if (_dispatcher != null)
11801181
{
1181-
_dispatcher.Invoke(() => _jsRuntime.Dispose());
1182+
_dispatcher.Invoke(() =>
1183+
{
1184+
_jsContext.Release();
1185+
_jsRuntime.Dispose();
1186+
});
11821187
_dispatcher.Dispose();
11831188
}
11841189

0 commit comments

Comments
 (0)