File tree Expand file tree Collapse file tree 6 files changed +48
-30
lines changed Expand file tree Collapse file tree 6 files changed +48
-30
lines changed Original file line number Diff line number Diff line change @@ -146,21 +146,30 @@ public override void Dispose()
146146 /// managed objects contained in fields of class</param>
147147 protected override void Dispose ( bool disposing )
148148 {
149- if ( _disposedFlag . Set ( ) )
149+ if ( disposing )
150150 {
151- if ( disposing )
151+ if ( _disposedFlag . Set ( ) )
152152 {
153153 _debugStackFrameSniffer32 = null ;
154154 _activeScriptDebug32 = null ;
155155 _activeScriptParse32 = null ;
156- }
157-
158- ComHelpers . ReleaseAndEmpty ( ref _pDebugStackFrameSniffer32 ) ;
159- ComHelpers . ReleaseAndEmpty ( ref _pActiveScriptDebug32 ) ;
160- ComHelpers . ReleaseAndEmpty ( ref _pActiveScriptParse32 ) ;
161156
162- base . Dispose ( disposing ) ;
157+ DisposeUnmanagedResources ( ) ;
158+ base . Dispose ( true ) ;
159+ }
163160 }
161+ else
162+ {
163+ DisposeUnmanagedResources ( ) ;
164+ base . Dispose ( false ) ;
165+ }
166+ }
167+
168+ private void DisposeUnmanagedResources ( )
169+ {
170+ ComHelpers . ReleaseAndEmpty ( ref _pDebugStackFrameSniffer32 ) ;
171+ ComHelpers . ReleaseAndEmpty ( ref _pActiveScriptDebug32 ) ;
172+ ComHelpers . ReleaseAndEmpty ( ref _pActiveScriptParse32 ) ;
164173 }
165174
166175 #endregion
Original file line number Diff line number Diff line change @@ -146,21 +146,30 @@ public override void Dispose()
146146 /// managed objects contained in fields of class</param>
147147 protected override void Dispose ( bool disposing )
148148 {
149- if ( _disposedFlag . Set ( ) )
149+ if ( disposing )
150150 {
151- if ( disposing )
151+ if ( _disposedFlag . Set ( ) )
152152 {
153153 _debugStackFrameSniffer64 = null ;
154154 _activeScriptDebug64 = null ;
155155 _activeScriptParse64 = null ;
156- }
157-
158- ComHelpers . ReleaseAndEmpty ( ref _pDebugStackFrameSniffer64 ) ;
159- ComHelpers . ReleaseAndEmpty ( ref _pActiveScriptDebug64 ) ;
160- ComHelpers . ReleaseAndEmpty ( ref _pActiveScriptParse64 ) ;
161156
162- base . Dispose ( disposing ) ;
157+ DisposeUnmanagedResources ( ) ;
158+ base . Dispose ( true ) ;
159+ }
163160 }
161+ else
162+ {
163+ DisposeUnmanagedResources ( ) ;
164+ base . Dispose ( false ) ;
165+ }
166+ }
167+
168+ private void DisposeUnmanagedResources ( )
169+ {
170+ ComHelpers . ReleaseAndEmpty ( ref _pDebugStackFrameSniffer64 ) ;
171+ ComHelpers . ReleaseAndEmpty ( ref _pActiveScriptDebug64 ) ;
172+ ComHelpers . ReleaseAndEmpty ( ref _pActiveScriptParse64 ) ;
164173 }
165174
166175 #endregion
Original file line number Diff line number Diff line change @@ -776,9 +776,9 @@ public override void Dispose()
776776 /// managed objects contained in fields of class</param>
777777 private void Dispose ( bool disposing )
778778 {
779- if ( _disposedFlag . Set ( ) )
779+ if ( disposing )
780780 {
781- if ( disposing )
781+ if ( _disposedFlag . Set ( ) )
782782 {
783783 if ( _dispatcher != null )
784784 {
@@ -794,10 +794,10 @@ private void Dispose(bool disposing)
794794 _typeMapper = null ;
795795 }
796796 }
797- else
798- {
799- DisposeUnmanagedResources ( ) ;
800- }
797+ }
798+ else
799+ {
800+ DisposeUnmanagedResources ( ) ;
801801 }
802802 }
803803
Original file line number Diff line number Diff line change @@ -830,9 +830,9 @@ public override void Dispose()
830830 /// managed objects contained in fields of class</param>
831831 private void Dispose ( bool disposing )
832832 {
833- if ( _disposedFlag . Set ( ) )
833+ if ( disposing )
834834 {
835- if ( disposing )
835+ if ( _disposedFlag . Set ( ) )
836836 {
837837 if ( _dispatcher != null )
838838 {
@@ -848,10 +848,10 @@ private void Dispose(bool disposing)
848848 _typeMapper = null ;
849849 }
850850 }
851- else
852- {
853- DisposeUnmanagedResources ( ) ;
854- }
851+ }
852+ else
853+ {
854+ DisposeUnmanagedResources ( ) ;
855855 }
856856 }
857857
Original file line number Diff line number Diff line change 2424 <IncludeSymbols >true</IncludeSymbols >
2525 <SymbolPackageFormat >snupkg</SymbolPackageFormat >
2626 <PackageTags >JavaScript;ECMAScript;MSIE;IE;Edge;Chakra</PackageTags >
27- <PackageReleaseNotes >Fixed a error “Program crash after function call with too much parameters” .</PackageReleaseNotes >
27+ <PackageReleaseNotes >Improved a implementation of the `Dispose` method .</PackageReleaseNotes >
2828 <NeutralLanguage >en-US</NeutralLanguage >
2929 <PackageOutputPath >../../nuget</PackageOutputPath >
3030 <GeneratePackageOnBuild Condition =" '$(Configuration)' == 'Release' " >true</GeneratePackageOnBuild >
Original file line number Diff line number Diff line change 2121 =============
2222 RELEASE NOTES
2323 =============
24- Fixed a error “Program crash after function call with too much parameters” .
24+ Improved a implementation of the `Dispose` method .
2525
2626 ============
2727 PROJECT SITE
You can’t perform that action at this time.
0 commit comments