File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
ClearScript/V8/ClearScriptV8 Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -737,6 +737,7 @@ V8ContextImpl::~V8ContextImpl()
737737 Dispose (m_hHostIteratorTemplate);
738738 Dispose (m_hHostDelegateTemplate);
739739 Dispose (m_hHostObjectTemplate);
740+ Dispose (m_hTerminationException);
740741 Dispose (m_hAccessToken);
741742 Dispose (m_hAccessTokenName);
742743 Dispose (m_hCachePropertyName);
Original file line number Diff line number Diff line change @@ -1901,6 +1901,35 @@ public void BugFix_VBScript_PropertyPut_CrossEngine_VBScript()
19011901 BugFix_VBScript_PropertyPut_CrossEngine ( ) ;
19021902 }
19031903
1904+ [ TestMethod , TestCategory ( "BugFix" ) ]
1905+ public void BugFix_SharedV8RuntimeLeak ( )
1906+ {
1907+ using ( var runtime = new V8Runtime ( ) )
1908+ {
1909+ using ( runtime . CreateScriptEngine ( ) )
1910+ {
1911+ }
1912+
1913+ runtime . CollectGarbage ( true ) ;
1914+ var heapSize = runtime . GetHeapInfo ( ) . TotalHeapSize ;
1915+
1916+ for ( var i = 0 ; i < 500 ; i ++ )
1917+ {
1918+ using ( runtime . CreateScriptEngine ( ) )
1919+ {
1920+ }
1921+
1922+ if ( ( i % 25 ) == 24 )
1923+ {
1924+ runtime . CollectGarbage ( true ) ;
1925+ }
1926+ }
1927+
1928+ runtime . CollectGarbage ( true ) ;
1929+ Assert . IsFalse ( runtime . GetHeapInfo ( ) . TotalHeapSize > ( heapSize * 1.5 ) ) ;
1930+ }
1931+ }
1932+
19041933 // ReSharper restore InconsistentNaming
19051934
19061935 #endregion
You can’t perform that action at this time.
0 commit comments