/// <summary> /// Releases the unmanaged resources used by the script engine and optionally releases the managed resources. /// </summary> /// <param name="disposing"><c>True</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> /// <remarks> /// This method is called by the public <see cref="ScriptEngine.Dispose()"/> method and the /// <see cref="ScriptEngine.Finalize">Finalize</see> method. /// <see cref="ScriptEngine.Dispose()"/> invokes the protected <c>Dispose(Boolean)</c> /// method with the <paramref name="disposing"/> parameter set to <c>true</c>. /// <see cref="ScriptEngine.Finalize">Finalize</see> invokes <c>Dispose(Boolean)</c> with /// <paramref name="disposing"/> set to <c>false</c>. /// </remarks> protected override void Dispose(bool disposing) { if (disposedFlag.Set()) { if (disposing) { ((IDisposable)script).Dispose(); proxy.Dispose(); } } }
/// <summary> /// Releases the unmanaged resources used by the script engine and optionally releases the managed resources. /// </summary> /// <param name="disposing"><c>True</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> /// <remarks> /// This method is called by the public <see cref="ScriptEngine.Dispose()"/> method and the /// <see cref="ScriptEngine.Finalize">Finalize</see> method. /// <see cref="ScriptEngine.Dispose()"/> invokes the protected <c>Dispose(Boolean)</c> /// method with the <paramref name="disposing"/> parameter set to <c>true</c>. /// <see cref="ScriptEngine.Finalize">Finalize</see> invokes <c>Dispose(Boolean)</c> with /// <paramref name="disposing"/> set to <c>false</c>. /// </remarks> protected override void Dispose(bool disposing) { if (!disposed) { if (disposing) { ((IDisposable)script).Dispose(); proxy.Dispose(); } disposed = true; } }