Skip to content

Commit cb5ad08

Browse files
committed
Remove ReturnEngineToPool method from factory as it's no longer needed
1 parent c366e3d commit cb5ad08

File tree

3 files changed

+1
-21
lines changed

3 files changed

+1
-21
lines changed

Diff for: src/React.Core/IJavaScriptEngineFactory.cs

-6
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,5 @@ public interface IJavaScriptEngineFactory
2626
/// </summary>
2727
/// <returns>The JavaScript engine</returns>
2828
PooledJsEngine GetEngine();
29-
30-
/// <summary>
31-
/// Returns an engine to the pool so it can be reused
32-
/// </summary>
33-
/// <param name="engine">Engine to return</param>
34-
void ReturnEngineToPool(PooledJsEngine engine);
3529
}
3630
}

Diff for: src/React.Core/JavaScriptEngineFactory.cs

-14
Original file line numberDiff line numberDiff line change
@@ -229,20 +229,6 @@ public virtual PooledJsEngine GetEngine()
229229
return _pool.GetEngine();
230230
}
231231

232-
/// <summary>
233-
/// Returns an engine to the pool so it can be reused
234-
/// </summary>
235-
/// <param name="engine">Engine to return</param>
236-
public virtual void ReturnEngineToPool(PooledJsEngine engine)
237-
{
238-
// This could be called from ReactEnvironment.Dispose if that class is disposed after
239-
// this class. Let's just ignore this if it's disposed.
240-
if (!_disposed)
241-
{
242-
engine.Dispose();
243-
}
244-
}
245-
246232
/// <summary>
247233
/// Gets a factory for the most appropriate JavaScript engine for the current environment.
248234
/// The first functioning JavaScript engine with the lowest priority will be used.

Diff for: src/React.Core/ReactEnvironment.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ public void ReturnEngineToPool()
400400
{
401401
if (_engineFromPool.IsValueCreated)
402402
{
403-
_engineFactory.ReturnEngineToPool(_engineFromPool.Value);
403+
_engineFromPool.Value.Dispose();
404404
_engineFromPool = new Lazy<PooledJsEngine>(() => _engineFactory.GetEngine());
405405
}
406406
}

0 commit comments

Comments
 (0)