Skip to content

Commit 0744840

Browse files
committed
In JavaScriptEngineSwitcher.ChakraCore an attempt was made to prevent a blocking of finalizer's thread
1 parent 710c5e6 commit 0744840

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Change log
22
==========
33

44
## June 26, 2017 - v2.4.7
5-
* In JavaScriptEngineSwitcher.ChakraCore now the original exception is added to instance of the `JsRuntimeException` class as an internal exception
5+
* In JavaScriptEngineSwitcher.ChakraCore now the original exception is added to instance of the `JsRuntimeException` class as an inner exception
66

77
## June 16, 2017 - v2.4.6
88
* In JavaScriptEngineSwitcher.ChakraCore added support of ChakraCore version 1.5.2

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>Now the original exception is added to instance of the `JsRuntimeException` class as an internal exception.</releaseNotes>
23+
<releaseNotes>An attempt was made to prevent a blocking of finalizer's thread.</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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
=============
3131
RELEASE NOTES
3232
=============
33-
Now the original exception is added to instance of the `JsRuntimeException`
34-
class as an internal exception.
33+
An attempt was made to prevent a blocking of finalizer's thread.
3534

3635
=============
3736
DOCUMENTATION

src/JavaScriptEngineSwitcher.ChakraCore/ScriptDispatcher.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,15 @@ private void EnqueueTask(ScriptTask task)
142142
/// <returns>Result of the delegate invocation</returns>
143143
private object InnnerInvoke(Func<object> del)
144144
{
145-
var waitHandle = new ManualResetEvent(false);
146-
var task = new ScriptTask(del, waitHandle);
147-
EnqueueTask(task);
145+
ScriptTask task;
148146

149-
waitHandle.WaitOne();
150-
waitHandle.Dispose();
147+
using (var waitHandle = new ManualResetEvent(false))
148+
{
149+
task = new ScriptTask(del, waitHandle);
150+
EnqueueTask(task);
151+
152+
waitHandle.WaitOne();
153+
}
151154

152155
if (task.Exception != null)
153156
{

0 commit comments

Comments
 (0)