Skip to content

Commit b698702

Browse files
committed
An attempt was made to prevent a blocking of finalizer's thread
1 parent d4f98cb commit b698702

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

NuGet/MsieJavaScriptEngine.nuspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
<summary>This library is a .NET wrapper for working with the JavaScript engines of Internet Explorer and Edge (JsRT versions of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine).</summary>
1515
<releaseNotes>1. In JsRT modes fixed a problems in calculation of error locations;
1616
2. An attempt was made to prevent occurrence of the access violation exception;
17-
3. Now the original exception is added to instance of the `JsRuntimeException` class as an inner exception.</releaseNotes>
17+
3. Now the original exception is added to instance of the `JsRuntimeException` class as an inner exception;
18+
4. An attempt was made to prevent a blocking of finalizer's thread.</releaseNotes>
1819
<copyright>Copyright (c) 2012-2017 Andrey Taritsyn - http://www.taritsyn.ru</copyright>
1920
<language>en-US</language>
2021
<tags>JavaScript ECMAScript MSIE IE Edge Chakra</tags>

NuGet/readme.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
1. In JsRT modes fixed a problems in calculation of error locations;
2525
2. An attempt was made to prevent occurrence of the access violation exception;
2626
3. Now the original exception is added to instance of the `JsRuntimeException`
27-
class as an inner exception.
27+
class as an inner exception;
28+
4. An attempt was made to prevent a blocking of finalizer's thread.
2829

2930
============
3031
PROJECT SITE

src/MsieJavaScriptEngine/ScriptDispatcher.cs

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

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

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

0 commit comments

Comments
 (0)