Skip to content

Commit 8a2b9b5

Browse files
committed
Version 1.4.2 (Fixed JavaScriptEngineSwitcher.Msie's bug #5 "MSIE "Catastrophic failure" when disposing")
1 parent 4b558a1 commit 8a2b9b5

File tree

6 files changed

+25
-13
lines changed

6 files changed

+25
-13
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Change log
22
==========
33

4+
## March 24, 2014 - v1.4.2
5+
* Fixed [JavaScriptEngineSwitcher.Msie's bug #5](http://github.com/Taritsyn/JavaScriptEngineSwitcher/issues/5) "MSIE "Catastrophic failure" when disposing"
6+
47
## March 22, 2014 - v1.4.1
58
* Fixed minor bugs
69

MsieJavaScriptEngine/ActiveScript/ActiveScriptJsEngineBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,11 @@ private void ExecuteResource(string resourceName, Type type)
257257
/// <param name="disposing">Flag, allowing destruction of
258258
/// managed objects contained in fields of class</param>
259259
private void Dispose(bool disposing)
260+
{
261+
_dispatcher.Invoke(DispatcherPriority.Input, (Action)InnerDispose);
262+
}
263+
264+
private void InnerDispose()
260265
{
261266
if (!_disposed)
262267
{

MsieJavaScriptEngine/JsRt/ChakraJsRtJsEngine.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ internal sealed class ChakraJsRtJsEngine : IInnerJsEngine
3333
private readonly JavaScriptContext _jsContext;
3434

3535
/// <summary>
36-
/// Synchronizer of code execution
36+
/// Synchronizer
3737
/// </summary>
38-
private readonly object _executionSynchronizer = new object();
38+
private readonly object _synchronizer = new object();
3939

4040
/// <summary>
4141
/// Flag that object is destroyed
@@ -272,7 +272,7 @@ private JsRuntimeException ConvertJavaScriptExceptionToJsRuntimeException(
272272

273273
private void InvokeScript(Action action)
274274
{
275-
lock (_executionSynchronizer)
275+
lock (_synchronizer)
276276
using (new JavaScriptContext.Scope(_jsContext))
277277
{
278278
try
@@ -288,7 +288,7 @@ private void InvokeScript(Action action)
288288

289289
private T InvokeScript<T>(Func<T> func)
290290
{
291-
lock (_executionSynchronizer)
291+
lock (_synchronizer)
292292
using (new JavaScriptContext.Scope(_jsContext))
293293
{
294294
try
@@ -309,11 +309,14 @@ private T InvokeScript<T>(Func<T> func)
309309
/// managed objects contained in fields of class</param>
310310
private void Dispose(bool disposing)
311311
{
312-
if (!_disposed)
312+
lock (_synchronizer)
313313
{
314-
_disposed = true;
314+
if (!_disposed)
315+
{
316+
_disposed = true;
315317

316-
_jsRuntime.Dispose();
318+
_jsRuntime.Dispose();
319+
}
317320
}
318321
}
319322

MsieJavaScriptEngine/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[assembly: ComVisible(false)]
1414
[assembly: Guid("ae6911c9-e2a9-4386-ab90-3722a9166564")]
1515

16-
[assembly: AssemblyVersion("1.4.1.0")]
17-
[assembly: AssemblyFileVersion("1.4.1.0")]
16+
[assembly: AssemblyVersion("1.4.2.0")]
17+
[assembly: AssemblyFileVersion("1.4.2.0")]
1818

1919
[module: DefaultCharSet(CharSet.Unicode)]

NuGet/MsieJavaScriptEngine.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>MsieJavaScriptEngine</id>
5-
<version>1.4.1</version>
5+
<version>1.4.2</version>
66
<title>MSIE JavaScript Engine for .NET</title>
77
<authors>Andrey Taritsyn</authors>
88
<owners>Andrey Taritsyn</owners>
@@ -12,7 +12,7 @@
1212
<requireLicenseAcceptance>false</requireLicenseAcceptance>
1313
<description>This project is a .NET wrapper for working with the Internet Explorer's JavaScript engines (JsRT version of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine). Project was based on the code of SassAndCoffee.JavaScript (http://github.com/paulcbetts/SassAndCoffee) and Chakra Sample Hosts (http://github.com/panopticoncentral/chakra-host).</description>
1414
<summary>This project is a .NET wrapper for working with the Internet Explorer's JavaScript engines (JsRT version of Chakra, ActiveScript version of Chakra and Classic JavaScript Engine).</summary>
15-
<releaseNotes>Fixed minor bugs.</releaseNotes>
15+
<releaseNotes>Fixed JavaScriptEngineSwitcher.Msie's bug #5 "MSIE "Catastrophic failure" when disposing".</releaseNotes>
1616
<copyright>Copyright 2014 Andrey Taritsyn - http://www.taritsyn.ru</copyright>
1717
<language>en-US</language>
1818
<tags>JavaScript ECMAScript MSIE IE Chakra</tags>

NuGet/readme.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

33
----------------------------------------------------------------------
4-
README file for MSIE JavaScript Engine for .NET 1.4.1
4+
README file for MSIE JavaScript Engine for .NET 1.4.2
55

66
----------------------------------------------------------------------
77

@@ -21,7 +21,8 @@
2121
=============
2222
RELEASE NOTES
2323
=============
24-
Fixed minor bugs.
24+
Fixed JavaScriptEngineSwitcher.Msie's bug #5 "MSIE "Catastrophic
25+
failure" when disposing".
2526

2627
============
2728
PROJECT SITE

0 commit comments

Comments
 (0)